I've been trying to get crontab to run a php script, but with no succes. I have tried to find php, but i cannot find the binaries. I've searched the filesystem and i tried these:

 

root@lamp ~# whereis php                                                                                                      
php:
root@lamp ~# which php
root@lamp ~# 
root@lamp ~# whereis php5
php5: /etc/php5 /usr/lib/php5 /usr/share/php5 
root@lamp ~# which php5
root@lamp ~# 
 
All are not revealing the binarys. Where is that php binarie stored?

Replies (4)

You may need to use the full path for php

Reply 1

Like this:

/usr/bin/php /var/www/pathto/file.php

You can also run php scripts with curl and wget. See this.

Thanks, Now i have the

Reply 2

Thanks,

Now i have the cronjob like this:

php /var/www/pathto/file.php

To run php from the command line you need php-cli

Reply 3

Install like this:

apt-get update && apt-get install php5-cli

Right you are.

Reply 4

Thanks for that. I just fixed it...