
Originally Posted by
DrByte
There's likely your problem: the needlessly repeated filename in PHP_SELF.
You beauty! That was it!
OK, with a few hours and a lot of googling, here's what I got:
I started here:
http://forum.nginx.org/read.php?11,2...439#msg-212439
which says (my emphasis)
decided to post my fastcgi_php.conf configuration file that helps me to resolve server environment compatibility issues with older PHP scripts that rely on PATH_INFO, PATH_TRANSLATED, SERVER_URL, SERVER_URI and PHP_SELF variables to be set correctly. Unfortunately, SCRIPT_NAME is not available, as if both SCRIPT_NAME and PHP_SELF are set in the FastCGI environment,
PHP_SELF will eventually contain a concatenated string (a bug in PHP (F)CGI mode? -
https://bugs.php.net/bug.php?id=55208)
Now, when I follow that bug tracker, it appears to be neither fixed nor closed, so the bug must still remain.
My server and config setup seems a little different to his, but eventually I worked out by trial and error that by commenting out
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
in /etc/nginx/fastcgi_params that made Zen cart login work! Hurrah!
Except, I found it then broke things like phpadmin - I get a 404 not found as soon as I enter username and password. I don't know why, it just does.
It seems to me that php server configs are set in both the params file - in my case /etc/nginx/fastcgi_params but can also be set "per location". So you remove fastcgi_param SCRIPT_NAME $fastcgi_script_name; from /etc/nginx/fastcgi_params to make Zen Cart work, and ADD it back into (in my case) /etc/nginx/sites-enabled/000-apps.vhost to make phpmyadmin work (phew!). Here's part of my 000-apps.vhost file now...
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; # THIS gets picked up first and needs the line fastcgi_param SCRIPT_NAME $fastcgi_script_name; removing
fastcgi_param SCRIPT_NAME $fastcgi_script_name; # THIS is what needs adding
# .... rest of file etc
Then just issue
service nginx restart
and you're away and laughing!

Originally Posted by
DrByte
I seem to recall that Windoze had a bug they had to fix in IIS a couple years back which was doing the same thing.
Maybe Nginx hasn't caught up yet.
It seems, in this case, to be more an issue with php-fpm than nginx. Why the bug hasn't been fixed I don't know, but I'll get onto them and add more info.
Meantime, big thanks for your help! I'll write all this up so it makes more sense in the next day or two, including the equivalent of the protection that .htaccess gives to certain location within Zen.