Cron job does not execute
Posted: Fri Dec 11, 2009 11:06 pm
Hello,
From the CPanel documentation
and the error (I got it through e-mail)
What does it mean ?
random.php starts like that
And if I 'execute' the file in the URL it does what it is supposed to do.
Why's that ?
Mihai
From the CPanel documentation
So I did this the path beingif I have a file x.php in my www directory, what should I put as the command in the standard cron jobs section to run that file?
You'll need to put the full path to that file as the command. Check the main screen of your cPanel interface for your home directory. It's likely something close to /home/username.
Now, add the directory that the file is in. For example, if your username is ron, and your home directory is /home/ron, you could run that file with /home/ron/www/x.php.
You will need to make sure that x.php is executable. You can check in the File Manager or an FTP program to make sure that the file has permissions necessary for execution (likely 755).
Note: Unless you want x.php to be available to the public, place it in /home/ron/ instead. It doesn't have to be in your www or public_html directory to be run by a cron job.
Code: Select all
/home/<my user>/public_html/random.phpCode: Select all
/home/<my user>/public_html/random.php: line 1: ?php
: No such file or directory
/home/<my user>/public_html/random.php: line 2: syntax error near unexpected token `"con.php"'
/home/<my user>/public_html/random.php: line 2: `include("con.php");
'random.php starts like that
Code: Select all
<?php
include("con.php");
............Why's that ?
Mihai