Cron job not working!! help!!!

waldopulanco29

New Member
Messages
14
Reaction score
0
Points
0
hello!! i have a problem with cron job. it doesn't work with me, my server is chopin.x10hosting.com
and here is my command
* * * * * php -q /home/username/etc/cron.php

it will execute every minutes.
but it will not execute.
and i have no email receive about cronjob is run!!

i hope it will fix as soon as posible.
my server is chopin.x10hosting.com

thanks in advance!!
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
As per the ToS, running a cron job every minute will get you suspended. You can run no more than one cron job every 5 minutes. You could fill out the minute field yourself (*/5), but a better choice for novices is to use cPanel's cron wizard.

"-q" isn't a valid command line option to PHP.

Give the full path to the PHP binary. Either "/usr/bin/php" or "/usr/local/bin/php" should work.
 

waldopulanco29

New Member
Messages
14
Reaction score
0
Points
0
sir which is the correct comand?
*/5 * * * * /usr/bin/php -q /home/username/etc/cron.php

or without -q?

*/5 * * * * /usr/bin/php /home/username/etc/cron.php

please give me some some sample!!

thanks in advance!
 

waldopulanco29

New Member
Messages
14
Reaction score
0
Points
0
i try the following command but it won't work

php -q /home/username/etc/cron.php

php-cron /home/username/etc/cron.php

php-cron -q /home/username/etc/cron.php

/usr/local/bin/php -q /home/username/etc/cron.php

/usr/bin/php -q /home/username/etc/cron.php
 
Last edited:

slacker_

New Member
Messages
16
Reaction score
1
Points
0
try

/usr/bin/php -f /home/waldopulanco29/path/to/your/cron.php
 

slacker_

New Member
Messages
16
Reaction score
1
Points
0
go to your cpanel, look at Stats -> Home Directory,
where you can see your username

scroll down to Advanced -> click on Cron jobs

under "add new cron job" click on "minute" -> every five minutes (*/5)

Command:
/usr/bin/php -f /home/your_username/www/cron.php >/dev/null 2>&1

which should work fine.

you can do a test write every 5 minutes, for example

cron.php:
PHP:
<?php
$content = ".";

$f = fopen ("/home/your_username/www/scores.txt", "a+");
fwrite($f,$content,strlen($content));
fclose($f); 

?>
(remember to create cron.php in your document root)

open "scores.txt" in your browser to see if it works,
there should be an dot added every five minutes..
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Don't revive dead threads. Don't pollute threads with contentless posts. If you wish to thank someone in these forums, use the "Like" link, or give them reputation.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Note the date on the earlier posts. It's been a year, so I doubt Waldo is still reading this thread. Just let it die.
 
Top