View Issue Details

IDProjectCategoryView StatusLast Update
0003086phpList 3 applicationCommand Linepublic19-05-05 19:36
Reporternetwear 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.9.4 
Target VersionFixed in Version 
Summary0003086: make commandline work with php < 4.3.0
DescriptionHello!

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:
http://www.phplist.com/forums/viewtopic.php?p=8715#8715

Harald
TagsNo tags attached.

Relationships

related to 0002457 resolvedmichiel PHPList v2.9.5 release 

Activities

michiel

30-04-05 00:20

manager   ~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") {
to
if (!isset($_SERVER["SERVER_NAME"]) && !php_sapi_name() == "cgi") {

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

Also processqueue.sh 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

to

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

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

Harald

michiel

19-05-05 19:36

manager   ~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.