How to configure phpmyadmin with nginx ?

Artifex Maximus artifexor at gmail.com
Mon Sep 14 17:09:37 MSD 2009


Hello!
I had the same problem and Igor said that nginx does not handle (yet?)
nested locations. So you have to write in this way:

location /phpmyadmin/ {
alias /usr/share/phpmyadmin/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
alias /usr/share/phpmyadmin/$1;
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}

Bye,
a

On Mon, Sep 14, 2009 at 10:00 AM, SE7EN <k1_zeus at yahoo.com> wrote:

> I think i got it, if i add this, it works but the images of phpmyadmin
> don't show, maybe a permission issue ?
>
>
> ndex index.php index.htm index.html;
> location   ^~ /phpmyadmin/ {
>   root /usr/share;
>   include /usr/local/nginx/conf/fastcgi_params;
>   fastcgi_pass  127.0.0:9002;
> }
>
>
> location ~ \.php$ {
>
> fastcgi_pass 127.0.0.1:9002;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
> include /usr/local/nginx/conf/fastcgi_params;
> }
>
>
>
>
> --- On *Mon, 9/14/09, Ian Hobson <ian at ianhobson.co.uk>* wrote:
>
>
> From: Ian Hobson <ian at ianhobson.co.uk>
> Subject: Re: How to configure phpmyadmin with nginx ?
> To: nginx at sysoev.ru
> Date: Monday, September 14, 2009, 12:52 AM
>
> Hi se7en,
>
> Your location line is incorrect and you may need a line to send php over
> also. Try the following inside your server directive.
>
> index index.php index.htm index.html;
> location   ^~ /phpmyadmin/ {
>   root /usr/share;
>   include /????/fastcgi_params;
>   fastcgi_pass  127.0.0:9002;
> }
> location ~ \.php {
>    include  /????/fastcgi_params;
>    fastcgi_pass  127.0.0.1:9002;
> }
>
> Don't forget to replace the ??? with the correct path - mine is /etc/nginx/
> and check that phpmyadmin
> has been installed in /usr/share/phpmyadmin - or adjust the root.
>
> Regards
>
> Ian
>
>
> SE7EN wrote:
> >
> > I added this,I verify it, everything is correct, my site works fine but
> accessing http://mydomain.com/phpmyadmin still doesn't work, a 500 server
> errror appears.
> >
> > location ~ /phpmyadmin/.*\.php$ {
> >   root /usr/share/;
> >   fastcgi_pass 127.0.0.1:9002;
> >   fastcgi_index index.php;
> >   include /usr/local/nginx/conf/fastcgi_params;
> >   fastcgi_param SCRIPT_FILENAME
> /usr/share/phpmyadmin$fastcgi_script_name;
> >   }
> >
> >   location /phpmyadmin/ {
> >   root /usr/share/;
> >   index index.php;
> >   }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090914/2bf4bb06/attachment.html>


More information about the nginx mailing list