Build the CentOS7 LNMP + phpmyadmin environment (3. Install phpmyadmin) and centos7lnmp

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.