Author Topic: How to set up the interest cron job in cPanel (step-by-step)  (Read 12206 times)

Offline Daniel15

Moved to the Wiki... Please see http://www.dansoftaustralia.net/smfshop_wiki/
« Last Edit: July 14, 2007, 08:29:12 pm by Daniel15 »

Offline Syndel

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #1 on: October 15, 2006, 01:34:15 pm »
It should add interest on a daily basis? Because its been a month that I fixed (finally) the file by creating my own empty interest_log.htm... and so far... nothing...

This is what my screen looks like:



And this is the... http://www.khaotikdezirez.com/interest_log.htm

Offline Daniel15

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #2 on: October 20, 2006, 09:48:28 pm »
Hmmm... It looks like there is a problem with running PHP in a cron job.
To fix this, create a file in your forum's directory. Give it a random name, like interest12312312.php. Place the following into it:
Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: dointerest.php
//      The file to add interest to member's bank

//VERSION: 1.31 (Build 7)
//DATE: 10th December 2005

include("/home/[username]/public_html/forum/SSI.php");

$interest_rate $modSettings['shopInterest'] / 100;
db_query("UPDATE {$db_prefix}members
SET moneyBank = moneyBank + (moneyBank*
{$interest_rate})"__FILE____LINE__);

echo 
"Interest added at ".date("d/m/Y h:i:s A");
}
?>


Then, change the cron command to:
Code: [Select]
wget -O - -q http://www.khaotikdezirez.com/forum/[filename].phpThat should work for you :)

Offline Aes-Sedai

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #3 on: April 28, 2007, 01:46:38 pm »
I installed the Cron Job the way you mentioned; but there doesn't seem to be interest generating - I looked for interest_log.htm but there was none there so I created one... I'm going to wait 24 hours to see if it works but should it generate interest WITHOUT the file?

Offline Daniel15

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #4 on: April 28, 2007, 02:01:11 pm »
I installed the Cron Job the way you mentioned; but there doesn't seem to be interest generating - I looked for interest_log.htm but there was none there so I created one... I'm going to wait 24 hours to see if it works but should it generate interest WITHOUT the file?

When the cron job runs, it creates the interest_log.htm file. After it has run, check that file. It should say "Interest added at " followed by the date and time :).

Offline Aes-Sedai

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #5 on: May 03, 2007, 02:18:28 pm »
Nup, nothing...

I created the log file myself as it wasn't appearing and it says 'no input file specified'

Offline Daniel15

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #6 on: May 04, 2007, 09:19:31 pm »
Nup, nothing...

I created the log file myself as it wasn't appearing and it says 'no input file specified'
That sounds like a PHP problem to me... "No input file specified"  is a common sign that PHP is misconfigured on the server.

Try getting rid of the -q from the command line, and see if that solves it.

Offline Aes-Sedai

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #7 on: May 05, 2007, 03:11:52 pm »
Well it added:

Status: 404
X-Powered-By: PHP/4.4.4
Content-type: text/html

to the file and I set the interest to rise every 5 minutes to see if there was any effect.

Is it working better though? I mean, will it start adding interest every 5 minutes after 12 hours?

TexasBartender

  • Guest
Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #8 on: May 16, 2007, 02:14:37 pm »
Well I did it like you say but it gave everyone max points how do i fix this

This is the command and i still dont have the interest_log.htm

/usr/bin/php -q /home/texasb/public_html/Sources/shop/dointerest.php > /home/texasb/public_html/interest_log.htm



Offline Aes-Sedai

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #9 on: May 16, 2007, 07:02:55 pm »
Well it added:

Status: 404
X-Powered-By: PHP/4.4.4
Content-type: text/html

to the file and I set the interest to rise every 5 minutes to see if there was any effect.

Is it working better though? I mean, will it start adding interest every 5 minutes after 12 hours?


I would like a bit of assistance here. I've waited patiently for ages.

Offline tfalbb

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #10 on: June 25, 2007, 11:16:46 pm »
Doesn't work for me. Not having CPanel or any way of setting up a cron job on the server I used www.cronjobs.org but still nothing.

I rather suspect that it's due to there being no SSI.php file in my /forum directory. Why isn't it there and where would I find it?

** edit - ok, found SSI.php in the original distribution. Don't know why it didn't copy over but it's there now.  Interest still doesn't appear to work.
« Last Edit: June 27, 2007, 01:50:25 pm by tfalbb »

Offline ibexy

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #11 on: July 04, 2007, 08:09:44 am »
my forum is installed directly to the public_html. I have this enterd as a cron job but interest is not calculating. Cant figure out why. its been 3 days since I put the command.

/usr/bin/php -q /home/albert/public_html/Sources/shop/dointerest.php > /home/albert/public_html/interest_log.htm

Offline ibexy

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #12 on: July 04, 2007, 06:52:58 pm »
Solved.

I created the htm file and loaded it to my forum root and that was it. It worked last night :)

Offline Aes-Sedai

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #13 on: July 06, 2007, 07:29:16 pm »
Quote
Well it added:

Status: 404
X-Powered-By: PHP/4.4.4
Content-type: text/html
No Imput File Specified

to the file and I set the interest to rise every 5 minutes to see if there was any effect.

Is it working better though? I mean, will it start adding interest every 5 minutes after 12 hours?



I would like a bit of assistance here. I've waited patiently for ages.

cough. It's been months now, still not working.

Offline CuTe_MaN

Re: How to set up the interest cron job in cPanel (step-by-step)
« Reply #14 on: July 14, 2007, 07:50:00 pm »
Hello all,

I cant get the interest to work.

I am using SMFSHOP 3.0

I have made all what you have said in this topic and the interest_log file was created automatically but I found this message in it:

Code: [Select]
Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(../../SSI.php): failed to open stream: No such file or directory in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Warning: main(): Failed opening '../../SSI.php' for inclusion (include_path='.:/usr/local/lib/php') in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 17

Fatal error: Call to undefined function:  db_query() in /hsphere/local/home/rsabouni/samasyria.net/smf/Sources/shop/dointerest.php on line 20

anybody can help???

CuTe_MaN