Recently, I installed phpMyAdmin from ArchLinux repository and tried to setup it to run on nginx. Compared with the phpMyAdmin instruction on Arch Wiki which is mostly written for apache, the configration on nginx is much easier.
- make a soft link in /srv/http/nginx for phpMyAdmin:
example: # ln -s /srv/http/nginx/phpMyAdmin /usr/share/webapps/phpMyAdmin - uncomment extensions(mycrypy.o and mysql.o) in /etc/php/php.ini
- The most important step:modify nginx.conf to support phpMyAdmin:
example:location ~ ^/phpMyAdmin { root html; <--- specify the phpMyAdmin directory fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; }
Then, restart php fcgi and nginx services.
PS: using “alias html/phpMyAdmin/” to replace ‘root’ line in nginx.conf is also ok. The difference between root and alias is that root specify the parent directory of the index file, while alias specify the exact directory where the index file locates.