SD_Syndicate

Registered
Jul 10, 2006
2
0
151
Newcastle, UK
Hi all,

First time on forum so bare with me :)

Ive used cPanel for a few years now and havent had any troubles until a few months ago.

I had my site down for awhile but Ive recently put it back up, althou when I create a CronJob I get an email saying...

/bin/sh: /home/user/public_html/includes/dailycheck.php: No such file or directory

I remember my friend saying that I cant use the 'GET' command anymore, so does anyone know what the command is just to run a basic '.php' page? I know how to set up the times to run it, I just cant seem to get the page to execute.

Thanks in advance.
 

webignition

Well-Known Member
Jan 22, 2005
1,880
0
166
SD_Syndicate said:
when I create a CronJob I get an email saying...

/bin/sh: /home/user/public_html/includes/dailycheck.php: No such file or directory
The file definitely exists?

SD_Syndicate said:
I remember my friend saying that I cant use the 'GET' command anymore, so does anyone know what the command is just to run a basic '.php' page? I know how to set up the times to run it, I just cant seem to get the page to execute.
Care you clarify what you mean by "I cant use the 'GET' command anymore"?

On top of that, a little bit of an explanation of running PHP scripts as cron jobs is required.

Executing a PHP script through a cron job is the same as executing it via the command line. Therefore if you have shell access, try the following:

Code:
/usr/bin/php /full/path/to/script.php
/full/path/to/script.php
The former should work, whereas the latter will only work if you PHP script has the correct shebang line present (#!/usr/bin/php).

If you only ever intend to run the PHP script via the command line (or via a cron job), you'd probably be better off adding the shebang line (it should be the very first line, before the opening '<?php') and moving the script to a non-browsable directory.
 

SD_Syndicate

Registered
Jul 10, 2006
2
0
151
Newcastle, UK
Thanks for the reply fellas.

The 'GET' command is what I used to use, cant remember it exactly but it was something like 'GET pagename.php </dev></null>'

Trying both your methods I now recieve an email saying

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

No input file specified.


is the link definatly '/home/user/public_html/includes/_dailycheck.php'? - and 'user' being my "Account Name"?
 
Last edited:

webignition

Well-Known Member
Jan 22, 2005
1,880
0
166
SD_Syndicate said:
Trying both your methods I now recieve an email saying

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

No input file specified.
That's an error from the PHP script. That is, the script is being executed by the cron job but is encountering an internal logic error. You'd have to troubleshoot the script itself.

SD_Syndicate said:
is the link definatly '/home/user/public_html/includes/_dailycheck.php'? - and 'user' being my "Account Name"?
The path is /home/user/path/to/script.php - the script does not necessarily have to reside in your public_html directory.