This is on a fresh install using nginx+php-5.3 and fpm. The issue is with installation which gets interrupted by these notices but does continue with install. The problem is that
"Notice: Undefined index: SCRIPT_NAME in includes/bootstrap.inc on line 328"
stay on the header of the page after installation and was able to get rid off
"Notice: Undefined index: SCRIPT_NAME in includes/bootstrap.inc on line 426"
by setting $base_url in settings.php but this doesn't get rid of the first notice above.

Details:
nginx-0.8.52
php-5.3.3-r3 w/ fpm
mysql-5.1.51

P.S phpinfo(); shows correct SCRIPT_NAME location

Comments

damien tournoud’s picture

Category: bug » support

You have configured your nginx server incorrectly, and it is not passing the correct FastCGI parameters.

Be careful, a poorly configured nginx can present serious security vulnerabilities. Be sure you know what you are doing.

likewhoa’s picture

nginx is properly configured to avoid such issues stated above so it's something else.. here is what it's being used for the domain in nginx.conf

         server {
                listen          ip:443;
                server_name     domain.com;
                
                ssl on;
                ssl_certificate         /etc/ssl/nginx/domain.com.crt;
                ssl_certificate_key     /etc/ssl/nginx/domain.com.key;
                
                access_log      /home/domain.com/logs/ssl_access_log main;
                error_log       /home/domain.com/logs/ssl_error_log info;
                
                root /home/domain/htdocs;
                
                location ~ .*\.php$ {
                        if (!-f $request_filename) {
                                return 404;
                        }
                        include /etc/nginx/fastcgi_params;
                        fastcgi_pass 127.0.0.1:9000;
                        fastcgi_index index.php;
                        fastcgi_param SCRIPT_FILENAME /home/domain.com/htdocs$fastcgi_script_name;
                }
        }      

I stripped down all the custom statements on the above nginx server setting and just left what normally would be standard settings, also cgi.fix_pathinfo=0 was already set. I don't see how nginx was mis-configured here when this same setup works with php-5.2, so it must be something else maybe something with php-5.3's fpm settings?

Thanks for your input.

likewhoa’s picture

Category: support » bug

switching to bug report since i cannot reproduce this with an older php version using fpm and same nginx settings.

likewhoa’s picture

Status: Active » Fixed

ok this has been fixed after removing a comment on

/etc/nginx/fastcgi_params

Thanks Damien for your feedback.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dandv’s picture

I've had the same issue with Drupal 7.2.

Comment #4 is vague to the point of being useless. What needs to be added to the nginx configuration in the location block is:

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

mymainmanbrown’s picture

Comment #4 was actually how I was able to fix having this problem myself.

In the file he mentions,

/etc/nginx/fastcgi_params

I had a line that was commented out that was the SCRIPT_NAME definition:

fastcgi_param	SCRIPT_FILENAME		$request_filename;
# fastcgi_param	SCRIPT_NAME		$fastcgi_script_name;
fastcgi_param	REQUEST_URI		$request_uri;
fastcgi_param	DOCUMENT_URI		$document_uri;
fastcgi_param	DOCUMENT_ROOT		$document_root;
fastcgi_param	SERVER_PROTOCOL		$server_protocol;

Which I changed to:

fastcgi_param	SCRIPT_FILENAME		$request_filename;
fastcgi_param	SCRIPT_NAME		$fastcgi_script_name;
fastcgi_param	REQUEST_URI		$request_uri;
fastcgi_param	DOCUMENT_URI		$document_uri;
fastcgi_param	DOCUMENT_ROOT		$document_root;
fastcgi_param	SERVER_PROTOCOL		$server_protocol;

I had to restart the nginx server (which I forgot how to do so I just rebooted the machine) and then it worked!

likewhoa’s picture

@dandv if you paid attention to the issue title it would have given you a clue as to what line to uncomment ;)