Build the CentOS7 LNMP + phpmyadmin environment (3. Install phpmyadmin) and centos7lnmp
We have installed the lnmp environment before. Now let's install phpmyadmin.
As before, the default yum library does not have phpmyadmin. We need to install it from the epel library. Friends who have installed epel can download the rpm package directly.
yum install epel-releaserpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Install phpmyadmin after the download is complete.
yum install --enablerepo=remi --enablerepo=remi-php56 phpmyadmin
Then, modify the nginx configuration file and add the phpmyadmin path.
vi /etc/nginx/conf.d/default.conf
Add the following code to the nginx configuration file. As shown in.
location /phpmyadmin { alias /usr/share/phpMyAdmin; index index.php; } location ~ /phpmyadmin/.+\.php$ { if ($fastcgi_script_name ~ /phpmyadmin/(.+\.php.*)$) { set $valid_fastcgi_script_name $1; } include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin/$valid_fastcgi_script_name; }
After the modification is complete, exit wq, then nginx-t checks the syntax, and nginx-s reload restarts nginx.
Finally, open the browser and access http: // localhost/phpmyadmin/. The following page is displayed.
So far, phpmyadmin configuration is complete. Finally, it is insecure to expose the database access address. It is best to configure a complex and irregular address.