Question

I have the following problem:

I'm using the latest crontab version with win 9x/nt

I put the crontab file, the exe file and the log file into the root of my website (aruba linux)

I put the following code inside the crontab file

0 24 * * * php example.php

In the example.php I make an insert

I've tried to do the operation going to the page and it's working fine.

However the crontab doesn't start, even modifying the minutes and hours like * *. In the log file there's written nothing.

I've read that the "php" voice represents the folder in which php is located.

How can know where is it on my website?

Do have to ask to the service of the server or what?

Was it helpful?

Solution

00 * * * * /usr/local/bin/php /home/username/myscript.php

  1. The first path is the location of your php binary
  2. The second path is the location of your php script.

OTHER TIPS

Just specify the absolute path for example.php.
Otherwise crontab will never find it to execute.

To find it, you can use echo __FILE__; so, you'll get the full path for script.

Try the absolute path of the php file, and the absolute path of the php command :

0 24 * * * /usr/bin/php /full/path/to/example.php

if /usr/bin/php is not working, try which php and replace /usr/bin/php with the result of this command .

the default folder for crontab is set in the /etc/crontab file in :

HOME=/path/

and you can change it to your default web root, this way you can use just example.php, but if only you have root access .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top