This article mainly introduces the CENTOS7 lnmp+phpmyadmin environment construction, the third phpMyAdmin installation, with a certain reference value, interested in small partners can refer tobefore we had installed the LNMP environment, let's now install the phpMyAdmin.
As before, the Yum Default library is not phpMyAdmin, we need to install from the Epel Library, and previously installed Epel friends can download the rpm package directly.
12 |
yum install epel-release rpm -ivh http: //rpms .famillecollet.com /enterprise/remi-release-7 .rpm |
Install phpMyAdmin after download is complete
1 |
yum install --enablerepo=remi --enablerepo=remi-php56 phpmyadmin |
Then, we change the Nginx configuration file and add the path of the phpMyAdmin.
1 |
vi /etc/nginx/conf .d /default .conf |
Add the following code to the Nginx configuration file. As shown in the following.
1234567891011121314 |
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 completed, still: Wq exit, then nginx-t detection syntax, nginx-s reload restart Nginx
Finally, when we open our browser and visit http://localhost/phpmyadmin/, we will see the following interface.
At this point, the phpMyAdmin configuration is complete. Finally, the access address of the database is not safe to expose, it is best to configure a complex irregular address.
CENTOS7 lnmp+phpmyadmin Environment Building Third phpMyAdmin installation