kristofferR Posted October 12, 2010 Share Posted October 12, 2010 When I run "php -q /var/www/site.com/public/kunde/pipe/pop.php" via cron, I only get a bunch of error messages: PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0 PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/ssh2.so' - /usr/lib/php5/20090626+lfs/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/suhosin.so' - /usr/lib/php5/20090626+lfs/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0 Site error: the file <b>/var/www/site.com/public/kunde/pipe/pop.php</b> requires the ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the site administrator. It's not looking the right places. IonCube and all the other libraries are properly installed (they show up with "phptest();") and WHMCS is otherwise running smoothly. How can I run the cron properly to ensure that IonCube and the other PHP-libraries are loaded as they should? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted October 12, 2010 Share Posted October 12, 2010 the command line php probably isnt picking up the correct php.ini file. To get around this, make a phpinfo page and copy down the location of the php.ini (commonly /usr/local/lib/php.ini) and then add it to your cronjob like so: php -c /usr/local/lib/php.ini -q /var/www/site.com/public/kunde/pipe/pop.php 0 Quote Link to comment Share on other sites More sharing options...
kristofferR Posted October 12, 2010 Author Share Posted October 12, 2010 Thanks, that fixes it! BTW, do you know how to change the preferred command line php.ini-file permanently so I wouldn't have had any issues like this one? I have command line root access and can change everything. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted October 12, 2010 Share Posted October 12, 2010 You're probably using the wrong version of PHP. Depending on the control panel, you probably have several versions of PHP installed. If you look at the phpinfo again as I previously mentioned, It should give you the full path to PHP (/usr/local/bin/php or whatever), If you specify this one on the command like rather than just "php", it should fix the problem. 0 Quote Link to comment Share on other sites More sharing options...
GGWH-James Posted October 12, 2010 Share Posted October 12, 2010 At the CLI, issue the command "which php". 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted October 12, 2010 Share Posted October 12, 2010 At the CLI, issue the command "which php". Thats not always true for a cron job. the PATH for cron is (sometimes) different from that of your login shell. The order and included directories will be relavent to what is returned by "which php". 0 Quote Link to comment Share on other sites More sharing options...
GGWH-James Posted October 12, 2010 Share Posted October 12, 2010 Thats not always true for a cron job. the PATH for cron is (sometimes) different from that of your login shell. The order and included directories will be relavent to what is returned by "which php". Ya, I forgot to mention that it should be ran from the same account that runs the cron. You're right though, there are several binaries available on most systems. I've never gone wrong with doing that yet though. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted October 12, 2010 Share Posted October 12, 2010 Ya, I forgot to mention that it should be ran from the same account that runs the cron. Still wouldn't matter. crond does not execute a login shell when running processes, thus, it will not pickup whatever PATH you have setup for that user. You can define the PATH within the crontab to match that of a login shell if you prefer, but its typically best not to assume a PATH is going to be correct and use the full path location for executables (like php for example). 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.