Configuring phpmyadmin

Hi All,

I’ve been round and round this problem for days now - and I still can’t
get it sorted.

I’m using Unbuntu LTS, and phpmyadmin - standard installs.

So far I have a file visible in /etc/nginx/sites-available that
contains:-

server for phpmyadmin

server {
listen 80;
server_name phpmyadmin.xxxxxxxxx.com;

location /phpmyadmin {
  root /usr/share;
  index index.php;

}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;
}
}

This serves the log-on screen, from url /phpmyadmin/index.php , and
includes the logo (from <img src=“./themes/original/img/logo_right.png”
id=“imLogo”… However, whatever I enter into the log-on boxes, I get
the log-on screen back - without any error messages. I have to conclude
that fastcgi is not recognising the post or it would say invalid
user/password.

The <form line is …

  1. How can I get the URI /phpmyadmin to serve /phpmyadmin/index.php
    ?

  2. How to get the post passed back to the CGI script.

The fastcgi_params file is included at the http level, and contains…

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

may be over-ridden at location level.

fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

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;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

fastcgi_index index.php;

PHP only, required if PHP was built with --enable-force-cgi-redirect

fastcgi_param REDIRECT_STATUS 200;

Regards

Ian

On Sat, Jan 31, 2009 at 12:05 AM, Ian H. [email protected]
wrote:

listen 80;
fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;

fastcgi_param QUERY_STRING $query_string;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param REDIRECT_STATUS 200;

Regards

Ian

have you properly configured phpmyadmin?

On Fri, Jan 30, 2009 at 05:05:09PM +0000, Ian H. wrote:

listen 80;
fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;
The <form line is …

  1. How can I get the URI /phpmyadmin to serve /phpmyadmin/index.php ?

  2. How to get the post passed back to the CGI script.

The fastcgi_params file is included at the http level, and contains…

You have to include them inside “location ~ .php$” as single
fastcgi_param discard all inherited fastcgi_param’s. This is why
PHP can not see POSTed body. Your location should be as

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
root /usr/share;
include fastcgi_params;
}

or as

http {

include fastcgi_params;

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
root /usr/share;
}

Thanks Igor.

Worked a charm :slight_smile:

Igor S. wrote:

The fastcgi_params file is included at the http level, and contains…

You have to include them inside “location ~ .php$” as single
fastcgi_param discard all inherited fastcgi_param’s. This is why
PHP can not see POSTed body. Your location should be as

I was expecting the values to be inherited. No wonder things made no
sense.

To me, this feels wrong. CGI params and variables that are set at a
higher level should be inherited (but may be over-written) at lower
levels. Still, I’m sute there is a good reason.

Thanks again.

Ian

Hi everyone,

I’d like to know about the behavior the nginx does load balancing.

Let’s say I have currently this situation

upstream phpfarm {

server server1:8080 weight=10;
server server2:8080 weight=10;
server server3:8080 weight=10;

}

Does the nginx sequentially work down the list until it reaches the end
and starts again from the beginning? We had some not-so-round balancing
peaks with this where some host sometimes got noticeable more hits then
the others.

My idea is to make it more even doing it for example this way. Is there
something wrong with it?

upstream phpfarm {

server server1:8080 weight=5;
server server2:8080 weight=5;
server server3:8080 weight=5;
server server1:8080 weight=5;
server server2:8080 weight=5;
server server3:8080 weight=5;

}

I am currently testing it by myself. Any ideas, thoughts or experiences?

Best regards,

Emil Krueper