Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th December 2011, 23:20
talkingnews talkingnews is offline
Member
 
Join Date: Jan 2011
Posts: 65
Thanks: 15
Thanked 5 Times in 5 Posts
Default Problem with fastcgi_param PHP_SELF and php-fpm - partial fix here.

Ubuntu 11.10
ISPC 3.0.4.1
Nginx 1.0.10
Zen Cart 1.3.9h - php cart software.

BIG problems with a login page - it just kept redirecting until it threw a "too many redirects" error.

Well, after 18 hours (no joke!) of going round and round in circles, with a little help from the developer of Zen Cart we spotted something:

For a script called, for example, phpinf0.php we get

_SERVER["PHP_SELF"] /phpinf0.php/phpinf0.php

which is clearly wrong and breaks certain scripts.

Finally, I ended up at

http://forum.nginx.org/read.php?11,2...439#msg-212439

locojohn's server setup is different to mine, and I am using ISPConfig so I have worker pools for php-fpm, so this is what I did:

In /etc/nginx/fastcgi_params , comment out the line

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

- that made Zen cart login work! But... it broke phpmyadmin.

So, my phpmyadmin block now looks like this

PHP Code:
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+.php)$ {
try_files $uri =404;
root /usr/share/;
include /
etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_NAME $fastcgi_script_name# THIS is what needs adding
# .... rest of file etc 
I don't know of any way of "unsetting" a server var/param once it's been set, because obviously, it would be better to REMOVE it from the one place it's causing trouble with the old script and leave the master config untouched, rather than delete it from the master file and have to add it back to various other locations "just in case". Any ideas?

This is noted in php bugs at https://bugs.php.net/bug.php?id=55208 but nothing has really been done since 2011-07-17 and as they're discussing 5.3.6 and I'm on 5.3.8, I guess it hadn't been resolved. However, it HAS taken up my entire weekend, so I'll be putting some effort into waking the bug report up a bit!
Reply With Quote
Sponsored Links
  #2  
Old 4th January 2012, 19:35
talkingnews talkingnews is offline
Member
 
Join Date: Jan 2011
Posts: 65
Thanks: 15
Thanked 5 Times in 5 Posts
Default

Has anyone got any ideas on this? This is truly becoming a PITA, as I have to gone in and re-add
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
back into apps.vhost under the phpmyadmin section every time I want to use it.

Of course, I suppose a better solution would be to "unset" the troublesome
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
in the nginx block for the "old" script for which is causes trouble, in the ISPC admin interface, but as you can see, this post is a few weeks old and despite occasional googling, I've not found a way of "unsetting" a fastcgi param.
Although I'd have a play with obvious things like " " and "" and just a blank space - it doesn't complain, but it doesn't do the trick either!

(Even better would be if php fixed that bug, but it's been a LONG time now!)
Reply With Quote
  #3  
Old 14th November 2012, 19:04
HellMind HellMind is offline
Member
 
Join Date: Jul 2008
Posts: 99
Thanks: 4
Thanked 1 Time in 1 Post
Send a message via ICQ to HellMind Send a message via MSN to HellMind
Default

I got the same problem

I you comment

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

you willl fix that redirection

but in the phpmyadmin it ill redircto to / instead /phpmyadmin when login in.


I think the solution is to change the template of the vhost creation for the php entries



location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9059;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_intercept_errors on;
}


I think this line:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
should be
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
or something like that
__________________
Ispconfig 3 Latest Version (Stable)
Debian Squeeze (esix vm)
Reply With Quote
  #4  
Old 14th November 2012, 19:18
HellMind HellMind is offline
Member
 
Join Date: Jul 2008
Posts: 99
Thanks: 4
Thanked 1 Time in 1 Post
Send a message via ICQ to HellMind Send a message via MSN to HellMind
 
Default

well that will not fix it.

I guess we should comment that line in fastcfig_params

and then if a vhost got problem set:
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
on the vhost cfg file.

lame
__________________
Ispconfig 3 Latest Version (Stable)
Debian Squeeze (esix vm)
Reply With Quote
Reply

Bookmarks

Tags
fast-cgi, nginx, php-fpm, zen cart

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:58.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.