LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-01-2011, 06:01 AM   #1
stephenl
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Rep: Reputation: 0
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
 
Old 10-01-2011, 06:42 AM   #2
mahu_mahu
Member
 
Registered: Dec 2007
Location: Japan
Distribution: Debian
Posts: 42

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

"*/5 * * * * php -f /root/cron/xyz.php" ?
 
Old 10-01-2011, 07:02 AM   #3
stephenl
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mahu_mahu View Post
>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
 
Old 10-01-2011, 05:36 PM   #4
mahu_mahu
Member
 
Registered: Dec 2007
Location: Japan
Distribution: Debian
Posts: 42

Rep: Reputation: 3
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.

Last edited by mahu_mahu; 10-01-2011 at 05:59 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiz: extension Composite: not present farzadfedora SUSE / openSUSE 1 01-19-2009 09:00 PM
Extension '*' not present and re-raiding? Jemburula Linux - Newbie 0 10-28-2007 07:35 PM
ndiswrapper shows 'driver present, hardware present' but no wlan0 0x12d3 Linux - Wireless Networking 2 05-11-2007 08:43 PM
X-Video Extension: no adaptors present ahz Fedora 1 01-09-2005 09:39 AM
X-Video Extension: no adaptors present ahz Linux - Hardware 1 01-08-2005 12:01 PM


All times are GMT -5. The time now is 08:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration