Re: Command line vs Cron
| From: | Richard Heyes | Date: | Tue, 08 Nov 2005 12:26:25 +0000 |
| Subject: | Re: Command line vs Cron | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225278@lists.php.net to get a copy of this message | ||
Dan Seibert wrote:
Richard Heyes wrote:Supply the full path to the correct binary, be it in your scripts' hash bang (ie. the top line: #!/usr/local/bin/php) or in your crontab, (eg. 0 0 * * * /usr/local/bin/php foo.php) -- Richard Heyes http://www.phpguru.orgDan Seibert wrote:Good call on that... I do have 2 php's compiled. Now, how do I tell the cron to look at the other PHP to run that job?I have a script that connects to a sybase server. It works fine if I launch it from a shell script however, if I try to launch the same script through a cron, I get the message "PHP Fatal Error: call to undefined function sybase_connect..." Why can I not connect to sybase through a cron but I can through shell?You may have two instances of the php cli/cgi binary, compiled differently. Try usinglocateorfindon the cmd line to find them.