note 34766 added to features.commandline

From: Date: Wed, 06 Aug 2003 02:12:59 +0000
Subject: note 34766 added to features.commandline
Groups: php.notes 
Request: Send a blank email to php-notes+get-53473@lists.php.net to get a copy of this message
The basic issue was that PHP-as-CGI REALLY REALLY wants SCRIPT_FILENAME. It ignores the command line. It ignores SCRIPT_NAME. It wants SCRIPT_FILENAME. "No input file specified." This very informative error message from PHP means that your web server, WHATEVER it is, is not setting SCRIPT_FILENAME. The minimum set of env variables: PATH: DOESN'T MATTER if you're spawning php pages with #!/../php in them LD_LIBRARY_PATH= should be right SERVER_SOFTWARE=mini_httpd/1.17beta1 26may2002 SERVER_NAME=who cares GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.0 SERVER_PORT=whatever REQUEST_METHOD=GET SCRIPT_NAME=/foo.php SCRIPT_FILENAME=/homes/foobie/mini/foo.php <--- CRITICAL QUERY_STRING==PHPE9568F35-D428-11d2-A769-00AA001ACF42 REMOTE_ADDR=172.17.12.80 HTTP_REFERER=http://booky16:10000/foo.php HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; .NET CLR 1.0.3705; .NET CLR 1.1.4322) If SCRIPT_FILENAME is not set, you'll get the dreaded "No input file specified" message. mini_httpd does not do this by default. You need to patch it in to make_envp. A secondary issue is configuration (PHP): ./configure --enable-discard-path --with-config-file-path=/homes/wherever/mini/php.ini (where php.ini is a slightly modified version of php.ini-recommended) ---- Manual Page -- http://www.php.net/manual/en/features.commandline.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34766 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34766&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34766&report=yes

« previous php.notes (#53473) next »