php-cli and php-cgi

wtfbrb

Verified User
Joined
Oct 11, 2009
Messages
71
Hey All,

On my last update I decided to do ./build all d with the following options.conf:

Code:
#PHP settings. default_php possible values - 4 or 5, php5_ver - 5.2 or 5.3
default_php=5
php5_ver=5.2
php4_cli=no
php4_cgi=no
php5_cli=no
php5_cgi=yes
zend=no

#Possible values - 5.0, 5.1
mysql=5.1
mysql_inst=no
mysql_backup=yes

#Possible values - 1.3, 2.0 or 2.2
apache_ver=2.2

#Web applications
phpmyadmin=yes
atmail=no
squirrelmail=yes
roundcube=no
uebimiau=no

#Mail options
exim=no
mail-header-patch=yes
dovecot=yes

#Statistics
awstats=no
webalizer=no

#FTP options
proftpd=yes


#Jailed shell (beta)
jail=no

#CustomBuild options
custombuild=1.1
autover=no
bold=yes
clean=no
clean_old_tarballs=no
clean_old_webapps=yes

#Cron settings
cron=yes
[email protected]
notifications=yes
da_autoupdate=no
updates=no
webapps_updates=yes

#CustomBuild 1.2 settings
php6_cli=no
php6_cgi=no
php_ini=no
#Possible values - recommended or dist
php_ini_type=recommended
cleanapache=no
fileserver=1
eximconf=no

However running php -v, we get this:

Code:
PHP 5.2.13 (cli) (built: Jun 19 2010 23:44:13)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.18, Copyright (c) 2002-2006, by Hardened-PHP Project

Any idea why after building everything again suddenly it says cli?
 
Last edited:
I'm not a php expert, but my best guess is that when your run php from the command line you're running it from the command line.

No, that's not necessarily circular reasoning.

Jeff
 
Create a file with this code:

Code:
<?php phpinfo(); ?>

Try to "call" this file from you favourite browser: I'me sure that you can find specific section with "php FastCGI". ;)

As jlasman wrote, you're using php by CLI.

If you want to have php-cgi from shell (you can have problem by calling script with cron) you must create symlink from /usr/local/bin/php to /usr/local/bin/php-cgi
 
I pulled my hair out for 10 hours trying to figure out why my CGI Wrappers would spit out the shell script and not run the code.

"PHP4 needs a specific configuration so that it won't try to execute the starter script.
Edit /etc/php4/cgi/php.ini, search for cgi.fix_pathinfo and set it to 1.

If you don't do this, PHP5 will work fine (it has cgi.fix_pathinfo compiled right in), but PHP4 will simply output the starter script. (You can even put <?php phpinfo (); ?> inside the starter script and will see the PHP information.)"
 
Back
Top