| Bug #19656 | FastCGI : Wrong SCRIPT_NAME and SCRIPT_FILENAME | ||||
|---|---|---|---|---|---|
| Submitted: | 29 Sep 2002 6:54am UTC | Modified: | 26 Nov 2002 7:58pm UTC | ||
| From: | elk at model-fx dot com | Assigned to: | |||
| Status: | No Feedback | Category: | Other web server | ||
| Version: | 4.2.3 | OS: | Linux 2.4.19 | ||
| Votes: | 43 | Avg. Score: | 3.3 ± 1.1 | Reproduced: | 16 of 21 (76.2%) |
| Same Version: | 9 (56.2%) | Same OS: | 8 (50.0%) | ||
[29 Sep 2002 7:22am UTC] elk at model-fx dot com
I don't think this hack still works for PHP < 4.2 because there is no _SERVER vars... aie...
[28 Oct 2002 10:46am UTC] iliaa@php.net
Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip
[28 Oct 2002 6:51pm UTC] elk at model-fx dot com
It doesn't work : Fatal error: input in flex scanner failed in - on line 1 Sorry... am I missing something ? --elk
[13 Nov 2002 1:00am UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[13 Nov 2002 12:30pm UTC] sniper@php.net
Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip And check what flex version you have installed. The latest CVS should warn if you have too old version.
[26 Nov 2002 7:58pm UTC] sniper@php.net
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.
[30 May 2007 1:22am UTC] kingsizewhopper at hotmail dot com
Still experiencing this bug in php 5.2.2! Can't this one be solved? (centos 4.4 | apache 2.0.59 + suexec | php 5.2.2 as fastcgi)

When running PHP under FastCGI (with Suexec wrapper enabled), the variables _SERVER["SCRIPT_NAME"] and _SERVER["SCRIPT_FILENAME"] are returning the path and filename of the PHP-FCGI binary instead of the path and filename of the current executing script, that is, the values of _ENV["SCRIPT_NAME"] and _ENV["SCRIPT_FILENAME"] respectively. This breaks a lot of scripts relying on just $SCRIPT_NAME and $SCRIPT_FILENAME; ie, when setting up this in httpd.conf : ScriptAlias /fcgi-bin/ /usr/local/apache/bin/ <Location /fcgi-bin/> SetHandler fastcgi-script </Location> AddType application/x-httpd-php .php .php3 .php4 Action application/x-httpd-php /fcgi-bin/php.fcgi When called from a script, $SCRIPT_NAME becomes : /fcgi-bin/php.fcgi $SCRIPT_FILENAME becomes : /usr/local/apache/bin/php.fcgi Versions : PHP 4.2.3 compiled with --with-fastcgi mod_fastcgi 2.2.12 Apache 1.3.26 I modified sapi/fastcgi.c to register the correct _SERVER vars, and it works OK. At line 164, add : php_register_variable("SCRIPT_NAME", (SG(request_info).request_uri ? SG(request_info).request_uri:""), track_vars_array TSRM LS_CC); php_register_variable("SCRIPT_FILENAME", (SG(request_info).path_translated ? SG(request_info).path_translated:""), track_var s_array TSRMLS_CC); Best, elk@model-fx.com