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