nginx + fast-cgi - how to make phpmyadmin work -


i've configured nginx server + php. eeverything works fine, except phpmyadmin.

i googled lot , found alias tricks, didn't work me.

that works great:

        location ~ ^/ololo/(.*\.php)$ {                 alias $root_path/img/$1;                 fastcgi_pass 127.0.0.1:9000;                 fastcgi_index index.php;                 include /etc/nginx/fastcgi_params;                 fastcgi_param script_filename $request_filename;         }          location /ololo/ {                 alias $root_path/img/;                 index index.php;         } 

there img directory in site path , when request sitename/ololo/ or sitename/ololo/index.php fine.

but that:

         location ~ ^/myadmin/(.*\.php)$ {                 alias /usr/share/phpmyadmin/$1;                 include /etc/nginx/fastcgi_params;                 fastcgi_pass 127.0.0.1:9000;                 fastcgi_index index.php;                 fastcgi_param script_filename $request_filename;          }          location /myadmin/ {                 alias /usr/share/phpmyadmin/;                 index index.php;         } 

won't work!

when i'm trying request mysite/myadmin/ or mysite/myadmin/index.php server throws me

no input file specified.

error message. in /usr/share/phpmyadmin/ .php files.

what's wrong nginx.conf?

ok according understood replies i'm modifying answer, add main server , should work.

location /phpmyadmin {     root /usr/share/;     index index.php index.html index.htm;     location ~ ^/phpmyadmin/(.+\.php)$ {         try_files $uri =404;         fastcgi_pass   unix:/var/run/php5-fpm.sock;         include fastcgi_params;     } } 

edit:

ok down vode made me take @ again, it's been while since i've wrote answer , should isn't how i'd write config file if today, here's config use.

location /phpmyadmin {     index index.php index.htm;     root /usr/share; }  location ~* \.php$ {     include fastcgi_params;     fastcgi_pass   unix:/var/run/php5-fpm.sock; } 

if want use alias replace phpmyadmin block this

location /phpmyadmin {     index index.php index.htm;     alias /usr/share/phpmyadmin; } 

note: if server block contains index don't need redefine inside phpmyadmin block.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -