LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Extension not present (https://www.linuxquestions.org/questions/linux-newbie-8/extension-not-present-905910/)

stephenl 10-01-2011 05:01 AM

Extension not present
 
Hello

I am having problems getting a php script to run as a cron job, I have searched the forum however been unable to find a solution..

Im running CentOS 5.5 and PHP 5.2.17

phpscript is located in :-
/root/cron/xyz.php
permissions are 750

1st 2 lines of the php script is :-
#!/usr/bin/php -q
<?php

Running the script from the command line works fine
ie php -f /root/cron/xyz.php

Cron setup is as follows :-
file var/spool/cron/root
contains 1 line as follows :-
*/5 * * * * /root/cron/xyz.php

The cron job runs every 5 mins, but produces the following error :-
Extension '/root/cron/xyz.php' not present.

/etc/crontab variables are as follows :-
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

Hopefully i have provided enough infor for someone to provide some guidance on where to start looking to resolve teh Extension not present error

Thank you in advance
Stephen

mahu_mahu 10-01-2011 05:42 AM

>contains 1 line as follows :-
>*/5 * * * * /root/cron/xyz.php

"*/5 * * * * php -f /root/cron/xyz.php" ?

stephenl 10-01-2011 06:02 AM

Quote:

Originally Posted by mahu_mahu (Post 4487082)
>contains 1 line as follows :-
>*/5 * * * * /root/cron/xyz.php

"*/5 * * * * php -f /root/cron/xyz.php" ?

Hi

Thank you for your reply....
Using your example, does the PHP file then need the #!/usr/bin/php -q as its 1st line ??

Kind Regards
Stephen

mahu_mahu 10-01-2011 04:36 PM

Sorry.

Quote:

/etc/crontab variables are as follows :-
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
But is your PHP 5.2.17 really located in the PATH?
Pls ensure which directory PHP 5.2.7 is installed.


All times are GMT -5. The time now is 11:12 PM.