Report this

What is the reason for this report?

PhpMyAdmin + NGINX + Ubuntu 12.04

Posted on April 19, 2014

Hi,

I have installed PhpMyAdmin by following the guides here: https://www.digitalocean.com/community/articles/how-to-install-phpmyadmin-on-a-lemp-server

  1. sudo apt-get install phpmyadmin
  2. sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www
  3. sudo nano /etc/nginx/sites-available/example.com
  4. Add the following lines:

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; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }

location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } }

  1. Save and exit
  2. sudo service nginx restart

But when I navigate to example.com/phpmyadmin I get a blank page. I also get a blank page when navigating to example.com/phpmyadmin/index.php

Any help would be great.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, I think I have the solution for your problem, in step 3 you have the website file in /etc/nginx/sites-available. The file must be in sites-enabled, use: <br>ln -s etc/nginx/sites-available/example.com etc/nginx/sites-enabled/ <br>Take care.

@Sianios - I have already enabled sites-enabled. Both virtual host contains the same information. <br> <br>Here is the information in both /etc/nginx/sites-available/example.com and /etc/nginx/sites-enabled/example.com <br> <br>server { <br> listen 80; <br> <br> <br> root /var/www/example.com/public_html; <br> index index.php index.html index.htm; <br> <br> server_name example.com www.example.com; <br> <br> location / { <br> try_files $uri $uri/ /index.html /index.php; <br> autoindex on; <br> } <br> <br> error_page 404 /404.html; <br> <br> error_page 500 502 503 504 /50x.html; <br> location = /50x.html { <br> root /usr/share/nginx/www; <br> } <br> <br> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 <br> location ~ .php$ { <br> try_files $uri =404; <br> fastcgi_pass unix:/var/run/php5-fpm.sock; <br> fastcgi_index index.php; <br> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; <br> include fastcgi_params; <br> } <br> <br> location /phpmyadmin { <br> root /usr/share; <br> index index.php index.html index.htm; <br> } <br> location ~ ^/phpmyadmin/(.+.php)$ { <br> try_files $uri =404; <br> fastcgi_pass unix:/var/run/php5-fpm.sock; <br> fastcgi_index index.php; <br> include fastcgi_params; <br> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; <br> } <br> location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { <br> root /usr/share; <br> } <br>

Issue resolved. phpmyadmin now works. I changed the etc/nginx/sites-available/example.com <br> <br>and added the following lines: <br> <br> location /phpmyadmin { <br> root /usr/share/; <br> index index.php index.html index.htm; <br> location ~ ^/phpmyadmin/(.+.php)$ { <br> try_files $uri =404; <br> root /usr/share/; <br> fastcgi_pass unix:/var/run/php5-fpm.sock; <br> fastcgi_index index.php; <br> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; <br> include fastcgi_params; <br> } <br> location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { <br> root /usr/share/; <br> } <br> } <br> location /phpMyAdmin { <br> rewrite ^/* /phpmyadmin last; <br> } <br> <br> <br> <br>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.