mst3kroqs
02-22-2008, 09:49 AM
BlueHost has apparently removed the cli version of php from many (if not all) of their nodes. This was (to me anyway) highly annoying, as all of the sites I support were broken as they 'upgraded' the nodes.
I utilize a cron job to invoke the 'process queue' command for phplist, and also any CMS or other script which requires a periodic execution of a schedule script will require this.
To find out what version of php is installed on your node, run php -v from a commandline, and look at what is displayed in parens after the version number.
For instance on my node, php -v yields:
PHP 5.2.5 (cgi-fcgi) (built: Jan 7 2008 14:20:05)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Note the version (cgi-fcgi).
This means that php scripts can no longer be executed from the commandline, and therefore instead you need to utilize a different methodology to run the script. This used to work:
/usr/bin/php -q /home/youracct/public_html/phplist/admin/index.php -p processqueue
.. not not any more. There are a few workarounds, but curl should do the trick. Try using the following commandline in your cron job (this should also work interactively from a shell). This example is given for phplist, however you get the general idea - we are using curl to retrieve/execute the script via httpd:
/usr/bin/curl 'http://www.yourdomain.com/phplist/admin/index.php?page=processqueue&login=YOURLOGIN&password=YOURPASSWORD'
The only downside associated with this workaround is that the script that you want to execute must exist in the public_html tree somewhere.
Anyway, this should work... at least, until they remove curl. ;^)
-m
I utilize a cron job to invoke the 'process queue' command for phplist, and also any CMS or other script which requires a periodic execution of a schedule script will require this.
To find out what version of php is installed on your node, run php -v from a commandline, and look at what is displayed in parens after the version number.
For instance on my node, php -v yields:
PHP 5.2.5 (cgi-fcgi) (built: Jan 7 2008 14:20:05)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Note the version (cgi-fcgi).
This means that php scripts can no longer be executed from the commandline, and therefore instead you need to utilize a different methodology to run the script. This used to work:
/usr/bin/php -q /home/youracct/public_html/phplist/admin/index.php -p processqueue
.. not not any more. There are a few workarounds, but curl should do the trick. Try using the following commandline in your cron job (this should also work interactively from a shell). This example is given for phplist, however you get the general idea - we are using curl to retrieve/execute the script via httpd:
/usr/bin/curl 'http://www.yourdomain.com/phplist/admin/index.php?page=processqueue&login=YOURLOGIN&password=YOURPASSWORD'
The only downside associated with this workaround is that the script that you want to execute must exist in the public_html tree somewhere.
Anyway, this should work... at least, until they remove curl. ;^)
-m