Attempting to install D7 on nginx results in the following errors, with nothing further below them. The nginx setup I'm using has been extensively tested with D6, and works fine for roughly 20 sites.
Notice: Undefined index: SCRIPT_NAME in /var/www/nginx-default/orangehattech.com/htdocs/includes/bootstrap.inc on line 389 Notice: Undefined index: SCRIPT_NAME in /var/www/nginx-default/orangehattech.com/htdocs/includes/bootstrap.inc on line 562 Warning: Cannot modify header information - headers already sent by (output started at /var/www/nginx-default/orangehattech.com/htdocs/includes/bootstrap.inc:389) in /var/www/nginx-default/orangehattech.com/htdocs/includes/install.inc on line 882 Warning: Cannot modify header information - headers already sent by (output started at /var/www/nginx-default/orangehattech.com/htdocs/includes/bootstrap.inc:389) in /var/www/nginx-default/orangehattech.com/htdocs/includes/install.inc on line 883 Fatal error: Call to undefined function drupal_exit() in /var/www/nginx-default/orangehattech.com/htdocs/includes/install.inc on line 884
I almost assigned this critical, as it completely disabled my use of drupal, however, I presume it's an nginx-only sort of issue, so perhaps it's not as critical as it appears to me.
Cheers!
-Dirkson
Comments
Comment #1
dirksonii commentedVerified that this bug occurs in the dev version as well.
Upgrading to critical, since, shucks, software not working on ~8% of all setups is pretty critical, no?
Comment #2
webchickIt is, indeed. Thanks for testing!
Comment #3
dave reidThanks for taking the time to report this issue.
However, I am marking this as a duplicate of #637146: HEAD install redirect fails because common.inc not loaded in _db_check_install_needed(). Please search for existing issues before submitting a new one.
You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.
This message is automatically generated. If you feel it could be improved, feel free to comment on http://drupal.org/node/467548
Comment #4
dirksonii commentedAfter applying the patch listed in the 'duplicate' thread, it removes the error the duplicate thread was created for, but still leaves me unable to install. Here is the new error:
Again, this error is presented on an otherwise blank screen.
What's really odd is that there aren't any errors listed anymore, just notices and warnings, which generally don't stop things from running. Perhaps there's some other problem going on here that I'm not savvy enough to have picked up on.
Comment #5
berdirThe issue is that these notices break the forwarding that is done with an HTTP Header which can't be sent anymore.
The code that causes this is the following:
Obviously, the check should use isset(), this is a bug. You can try to replace that line with:
I don't know if nginx does provide a SCRIPT_FILENAME variable instead, you might still get a NOTICE now about SCRIPT_FILENAME. If so, you need to figure out if nginx provides anything than can be used instead of those two. (var_dump($_SERVER) and look what's there...)
Comment #6
dirksonii commentedAh hah! After puzzling at your response for a good long time, I realized that I can simply add SCRIPT_NAME to the list of variables provided by nginx, and get rid of these errors altogether. This is a new step in making drupal 7 work with nginx, but probably not a bug itself- Just some documentation that needs updating. Perhaps I'll do a blog post about it... Should I ever manage to get my new site up ;)
However, while all the errors have gone away, I'm still left with an utterly blank screen. Going to the url in question /does/ now forward me on to install.php, but install.php appears completely blank.
-Dirkson
Comment #7
dirksonii commentedAh! It looks like "REMOTE_ADDR", which install.php expects to be filled with something, is, of course, quite empty. What is it expecting here?
In the meantime, I removed the remote_addr requirement, and got the following errors, and, more importantly, a working install prompt. Errors include for the curious.
Looks like it expects SERVER_SOFTWARE. What does it expect THAT to be?
-Dirkson
Comment #8
dirksonii commentedAfter locating some really good guesses at REMOTE_ADDR and SERVER_SOFTWARE, and telling nginx to provide them, I was able to get the installer to quit complaining about those two.
Now, it has the following two errors. The first is on the normal page:
Fatal error: Class 'MergeQuery' not found in /var/www/nginx-default/orangehattech.com/htdocs/includes/database/database.inc on line 740
The second is on the install page, after getting past the "Fill in all your site/user information" stage.
Fatal error: Class 'DrupalQueue' not found in /var/www/nginx-default/orangehattech.com/htdocs/modules/update/update.install on line 74
Comment #9
webchickWe have a new http://api.drupal.org/api/function/drupal_environment_initialize/7 function which is intended for, well, initializing environment variables like this. dirksonii, is it possible for you to modify that function so that it does so accordingly, and then post a patch? Or is this truly a mere server configuration thing?
If so, could you maybe make a page under http://drupal.org/node/346385 if it doesn't exist already, in addition to your blog post, once you get this figured out? :) That's where most people will be looking for this kind of info, I think (or somewhere under the installation guide at any rate)
Comment #10
dave reidFeels like this is stuff under Stuff that you need to correct on your funky webserver configuration or software. We should add a more easily findable 'Installing Drupal on [server type x]' section.
Comment #11
dirksonii commentedWell, nginx handles these sorts of variables a little differently than apache does. With nginx, I'm talking directly to a php daemon, and I pass it various variables that it uses.
The following gives is the code snippet that tells the php daemon what to do, with D7 specific changes marked as //NEW :
I presume all of this (and more) is provided to php by apache as a matter of course, but nginx provides nothing by default. I'll be sure to make a page where you say as well, documenting what changes I had to apply to nginx to make D7 hale and healthy : )
Unfortunately, my PHP isn't really strong enough for me to feel comfortable writing code others rely on. In case someone reads this who /can/ code the necessary changes, I feel I should mention that not all variables can just be made up by drupal, I think- REMOTE_ADDR, for example, seems to expect the remote IP address, which may have rather nasty effects if you try to fake it. However, SCRIPT_NAME can by synthesized from SCRIPT_FILENAME, and I can't imagine that you couldn't just make up an 'unknown' default value for "SERVER_SOFTWARE".
I'm still a bit lost on the other errors- the 'line 740' appears to be the major one. I found a couple other issues with this error mentioned, but at least one is definitely not related (sqlite issue), so I'm not sure if it's a duplicate or not.
-Dirkson
Comment #12
Coornail commentedDrupal 7 alpha installed and running at me on nginx without a problem.
(PHP 5.2.12-pl0-gentoo with Suhosin-Patch 0.9.7, nginx-0.8.31[+addition +aio +fastcgi +imap +pcre +perl +pop +smtp +ssl +zlib -debug -flv -ipv6 -random-index -realip -securelink -static-gzip -status -sub -webdav])
Do you want to see my configs?
Comment #13
chx commentedI suspect a won't fix in the coming but for now (for lacking a better issue status) I set it like this. Once you identified a bug please reset to active.
Comment #14
dirksonii commentedWell, I'm still stuck with the 'line 740' problem, without any indication of how to move forward from it. It's no longer directly implicating nginx through variables, but it's also not outputting an error I can make much of an educated guess at.
Basically, you can post your configs, it certainly won't hurt, but I don't know what to look for in specific that could be causing the problem now.
Comment #15
dirksonii commentedHey! Attempting yet another reinstall with today's dev version and a 'minimal' install results in success.
Two errors, though.
Easy to resolve by adding the variable to the fcgi lines.
Occurs when looking at the site after the install. This appears to be another "Missing from my D6 nginx config" line; adding REQUEST_URI solves it quite nicely.
Neither errors /appears/ to have any negative effects.
Comment #16
MTecknology commentedCould I get your config? I'm having the exact same problem. If possible, maybe the whole thing so I can see if I screwed up on anything else.
Comment #17
MTecknology commentedI missed the part about REQUEST_URI; that with the other stuff mentioned seems to work great. Thanks.
Comment #18
chx commentedComment #19
MTecknology commentedThere's a crap ton of documentation for D7 and Nignx. The Nginx wiki documents a flawless setup of Drupal 6/7. http://wiki.nginx.org/Drupal
Comment #21
c0psrul3 commentedi use the include directive:
in your vhost site .conf file do:
this will point to (usually) /etc/nginx/fastcgi_params
where you can include these nice server variables for your entire server (or at least for each vhost that is including this file).
:D