Friday, July 31, 2009

Nginx + PHP-FPM : $_SERVER[PHP_SELF] returning itself twice

Writing this down here in case anyone else encounters the same.

I got the $_SERVER[PHP_SELF] returning itself twice (eg. /123.php/123.php instead of /123.php as it should be) with my Nginx and PHP-FPM server. (Nginx 0.7.61, PHP 5.3.0)

Seems that the issue lies with the fastcgi configuration that I used. Make sure that this is not set.

# fastcgi_param PATH_INFO $fastcgi_script_name; #do not use, causes php_self to screw up

5 comments:

Anonymous said...

Thank you

Mattia Trapani said...

Thanks a lot :)

Anonymous said...

THANK YOU! Solved hours of frustration for me :)

Michal Palma said...

Thanks a lot, works like a charm at nginx 1.0.11 too :-)

Unknown said...

You're very welcome :)