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.
From: http://ubuntuforums.org/showthread.php?t=341164&highlight=apache+php
"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.)"
CLI şi CGI
În PHP 5 au survenit unele modificări ale denumirilor fişierelor CLI şi CGI. În PHP 5 versiunea CGI a fost redenumită în php-cgi.exe (anterior php.exe) şi versiunea CLI acum se află în directorul principal (anterior cli/php.exe).
În PHP 5 a fost introdus un mod nou: php-win.exe. Acesta este echivalent cu versiunea CLI, cu excepţia că php-win nu afişează nimic şi astfel nu oferă o consolă (pe ecran nu apare "cutia DOS"). Acest comportament este similar cu cel al php-gtk.
În PHP 5, versiunea CLI întotdeauna va popula variabilele globale $argv şi $argc indiferent de careva setări ale directivelor php.ini. Chiar având register_argc_argv stabilit off nu va avea efect în CLI.
Accesaţi de asemenea referinţa liniei de comandă.
CLI şi CGI
12-Mar-2008 08:41
