PDA

View Full Version : PHP as CLI and CGI when only CGI selected



suhailc
02-12-2008, 08:35 AM
Hmm,

On one of our servers, PHP was previously built with PHP 5 as CGI, and PHP 4 as CLI, but because PHP 5.2.5 is not compatible with Ioncube encoders, it was changed to PHP 4 as CGI, and PHP 5 as CLI.

However now it's currently got:


#PHP settings. default_php possible values - 4 or 5
default_php=4
php4_cli=no
php4_cgi=yes
php5_cli=no
php5_cgi=no
zend=yes

Yet after running
"./build php d"I still see:


server4# php -v
PHP 5.2.5 (cli) (built: Feb 9 2008 18:51:04)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.2.8, Copyright (c) 1998-2007, by Zend Technologies

Any ideas?

Regards,
Suhail.

smtalk
02-12-2008, 09:48 AM
PHP 5.2.5 is compatible with ionCube loaders. You just need to load them directly from PHP configuration file. php -v shows "/usr/local/bin/php -v", for CGI (PHP 4) installation you need to run "/usr/local/php4/bin/php -v" (check CustomBuild FAQ: http://directadmin.com/forum/showthread.php?t=19221 #15).

suhailc
02-12-2008, 12:50 PM
Hi Martynas,

So how can I only run one version of PHP, i.e. PHP 4 CGI with SuPHP?

Regards,
Suhail.

smtalk
02-12-2008, 01:38 PM
php4_cgi=yes


And set the others to "no". Then run: "./build php n".

suhailc
02-12-2008, 03:28 PM
php4_cgi=yes


And set the others to "no". Then run: "./build php n".

Okay done, but I still see:


server4# php -v
PHP 4.4.8 (cli) (built: Feb 12 2008 20:59:44)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.2.8, Copyright (c) 1998-2007, by Zend Technologies

at the same time as:


server4# /usr/local/php4/bin/php -v
PHP 4.4.8 (cgi-fcgi) (built: Feb 12 2008 23:16:20)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

Additionally, how should Zend Optimizer be added to the PHP 4 CGI?

Regards,
Suhail.

smtalk
02-12-2008, 11:13 PM
So, you have PHP4 as cgi. "/usr/local/php4/bin/php -v" shows it.