View Issue Details

IDProjectCategoryView StatusLast Update
0003086phpList 3 applicationCommand Linepublic19-05-05 20:36
Reporternetwear Assigned To 
Status resolvedResolutionfixed 
Product Version2.9.4 
Summary0003086: make commandline work with php < 4.3.0

admin/index.php uses PHP_SAPI constant (CLI) to identify commandline modus and therefor needs PHP 4.3.0 or higher

I found out that with little modification this can also be done with PHP 4.1.2
Maybe it would be nice to integrate same compatiblility to older PHP Versions if there is no other reason against it...

My hack is in the forum:

TagsNo tags attached.


related to 0002457 resolvedmichiel PHPList v2.9.5 release 



30-04-05 01:20

administrator   ~0004583

Pasted from forum, just to have it in one place:
My PHP version ist 4.1.2 and not 4.3.0 or higher as stated in README.Commandline

Technically this means the constant PHP_SAPI used by index.php to identify commandline modus is not available in this PHP Version. Since I didnĀ“t want to update my PHP for different reasons, I changed 2 lines of code in /admin/index.php:

Line 6:
if (!isset($_SERVER["SERVER_NAME"]) && !PHP_SAPI == "cli") {
if (!isset($_SERVER["SERVER_NAME"]) && !php_sapi_name() == "cgi") {

Line 25:
if (PHP_SAPI == "cli") {
if (php_sapi_name() == "cgi") {

Also seems not to be uptodate since line 18 has to be changed from

$php $path/index.php page=processqueue login=$username password=$password > /dev/null 2>&1


$php $path/index.php -p processqueue > /dev/null 2>&1

I hope this helps for somebody experiencing the same problem...



19-05-05 20:36

administrator   ~0004936

fixed in CVS. I didn't change the warning check, but I did change the main check to get into commandline. Interestingly enough, quite some people also use the cgi version on commandline.