crontab not working

Status
Not open for further replies.

orgutz

New Member
Messages
8
Reaction score
0
Points
0
I have recently gotten a free website, and everything is working perfectly, except the crontab jobs. I have tried different solutions found in this forum, with no success.
In crontab jobs I have entered the comand:
php-cron /home/orgutz/public_html/balances.php and I receive an email telling me /bin/sh: php-cron: Command not found
I have changed to /usr/bin/php, /usr/local/bin/php, php, but sometimes I don't even get an email.
I also included a line in the php program: #!/bin/php. Email:No such interpreter.
The program balances.php works perfectly when launched in the browser, and was working also in another server.
I think that the crontab is not finding the path to the php interpreter.
The timing of the crontab is working.
Other programs, about 25 are working smoothly, with HTML, PHP and JavaScript. Also AJAX is working.
Also I checked the status of the server starka, and it is working, and I have Intermediate PHP level.
I have tried all the solutions I searched in the forums, for the PHP path.
I appreciate any help,

Thanks,
 

jtwhite

Community Advocate
Community Support
Messages
1,381
Reaction score
30
Points
0
Try:

Code:
php /home/orgutz/public_html/balances.php

If that doesn't work try:

Code:
php -q /home/orgutz/public_html/balances.php
 

orgutz

New Member
Messages
8
Reaction score
0
Points
0
Thanks for your response. I have tried the two options.
php does nothing, not even email an error message.
php -q does the same. I think I read somewhere that the option -q is quiet, so no email is sent.
the permissions of the balances file are 755.
I have also tried:
/usr/local/bin/php
/usr/bin/php
/usr/bin/local/php-cron
/usr/bin/php-cron
some of them will email me an error message.

I will keep on trying a little before I seek help from the guys at x10.

Thanks again.
 

jtwhite

Community Advocate
Community Support
Messages
1,381
Reaction score
30
Points
0
Are you sure your scripts are error free?

Edit: Have you tried:

Code:
php /public_html/balances.php
 
Last edited:

orgutz

New Member
Messages
8
Reaction score
0
Points
0
to Justin:
the program balances.php runs perfectly from the browser. Also it was running in another server's crontab. I actually was running 4 programs at different times during the month. balances.php is supposed to run once every day.

to dmoneyman:
I tried:
php balances.php and nothing happened.

When entering /usr/php-cron I receive an email with:

/bin/sh: /usr/php-cron: No such file or directory
 

jtwhite

Community Advocate
Community Support
Messages
1,381
Reaction score
30
Points
0
to Justin:
the program balances.php runs perfectly from the browser. Also it was running in another server's crontab. I actually was running 4 programs at different times during the month. balances.php is supposed to run once every day.

to dmoneyman:
I tried:
php balances.php and nothing happened.

When entering /usr/php-cron I receive an email with:

/bin/sh: /usr/php-cron: No such file or directory


But did you try:

Code:
php /public_html/balances.php
?

I think that should work?
 
Last edited:

orgutz

New Member
Messages
8
Reaction score
0
Points
0
Justin:

I have tried php /public_html/balances.php and nothing happened.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Which server are you on?

If you get it to work, please post here what the problem was. Several people have had problems getting cron jobs to work, yet nobody seems to come back to explain how they got them to work (if they did instead of just giving up).
 

orgutz

New Member
Messages
8
Reaction score
0
Points
0
to Descalzo:
I am on starka. But the crontab part works. Sometimes I get an email. I think the problem is the path to the php interpreter.
I am not ready to give up yet.
If I get that to work I will post the solution.
 
Status
Not open for further replies.
Top