#33392 [Opn]: unable to override SCRIPT_FILENAME for input source
ID: 33392
User updated by: php dot 5 dot magnum3065 at spamgourmet dot com
Reported By: php dot 5 dot magnum3065 at spamgourmet dot com
Status: Open
Bug Type: CGI related
Operating System: Debian GNU/Linux
PHP Version: 5.0.4
New Comment:
Upon further investigation it appears that the SCRIPT_FILENAME variable
is actually required if any of the following are set: SERVER_NAME,
SERVER_SOFTWARE, REQUEST_METHOD, PATH_TRANSLATED, GATEWAY_INTERFACE.
Previous Comments:
------------------------------------------------------------------------
[2005-06-18 06:12:43] php dot 5 dot magnum3065 at spamgourmet dot com
Oops, the trailing slash on not_me.txt/ is a typo.
------------------------------------------------------------------------
[2005-06-18 06:11:02] php dot 5 dot magnum3065 at spamgourmet dot com
Description:
------------
When the SCRIPT_FILENAME environment variable is set this is given
precedence over all other ways of providing the input source.
I am trying to use the PHP executable to provide syntax highlighting of
PHP source within a web application (not PHP-based). However since the
PHP executable is called from within the CGI application, the
SCRIPT_FILENAME variable is set to the CGI file. So, rather than
highlighting the content I've tried passing through stdin, as well as a
filename parameter to the executable, PHP processes the CGI file.
This filename provided as a command line parameter should be given
precedence, and if "-" is given as the filename, the content should be
processed from stdin.
Reproduce code:
---------------
From a bash command line:
$ echo "Content I want highlighted" > process_me.txt
$ echo "This gets output instead" > not_me.txt
$ export SCRIPT_FILENAME=not_me.txt/
$ php -qs process_me.txt
Expected result:
----------------
<code><span style="color: #000000">
Content I want highlighted<br /></span>
Actual result:
--------------
<code><span style="color: #000000">
This gets output instead<br /></span>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33392&edit=1
Thread (7 messages)