PHP_SELF not set

Nuno Magalhães nunomagalhaes at
Sat Sep 12 00:45:27 MSD 2009

On Fri, Sep 11, 2009 at 21:15, durist <nginx-forum at> wrote:
> I am trying to configure cacti under nginx. It makes heavy use of the $_SERVER['PHP_SELF'] variable, but this isn't getting set. I've tried setting it explicitly; e.g.
>   fastcgi_param PHP_SELF $fastcgi_script_name;
> but when I dump the $_SERVER variable from PHP it's still not set. I've tried passing other variables to PHP this way as a test, and I can see them when I dump $_SERVER, so I'm wondering if nginx is stripping this, and if there's a workaround. I'm using the Ubuntu nginx 0.6.35 package under jaunty.

The latest stable version is 7.6.1, you could try compiling from
source. What's Ubuntu's default fastcgi_params file? Here are a few on

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  DOCUMENT_URI       $document_uri;

Are those on yours? I've commented out fastcgi_param  DOCUMENT_ROOT
because i define that under each virtual host. Your nginx.conf could
also provide some clues, as well as PHP's error log (set php.ini to
log to a file) and nginx's error.log as well.

Nuno Magalhães

()  ascii-rubanda kampajno - kontraŭ html-a retpoŝto
/\  ascii ribbon campaign - against html e-mail

More information about the nginx mailing list