Home  >  Article  >  Database  >  nginx server supports phpmyadmin configuration

nginx server supports phpmyadmin configuration

王林
王林Original
2019-12-11 15:52:155931browse

nginx server supports phpmyadmin configuration

1. First download and decompress phpmyadmin

After the download is complete, decompress:

unzip phpMyAdmin-4.1.12-all-languages.zip

Move to the corresponding directory location and change into an easily accessible name:

mv phpMyAdmin-4.1.12-all-languages /www/phpmyadmin

2. Then configure phpmyadmin

Copy a configuration file:

#cd /www/phpmyadmin
#cp config.sample.inc.php config.inc.php

Configuration config.inc.php

#vi config.inc.php

Set a secret key for internal use (related to internal encryption, not directly related to page login)

$cfg['blowfish_secret'] = ‘www.tudaxia.com';

3. Configure the site under Nginx

vi /etc/nginx/conf.d/phpmyadmin.conf
server {
 listen 8081;
 server_name localhost;
 access_log /var/log/nginx/phpmyadmin-access.log main;

 location / {
  root /www/phpmyadmin;
  index index.php;
 }

 location ~ \.php$ {
  root /www/phpmyadmin;
  fastcgi_pass  unix:/var/run/php-fpm/php-fpm.sock;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  include fastcgi_params;
 }

 location ~ /\.ht {
  deny all;
 }
}

4. Restart nginx

#service nginx restart

Configuration completed.

Recommended related article tutorials: phpmyadmin tutorial

The above is the detailed content of nginx server supports phpmyadmin configuration. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn