CentOS 7.x installation Apache[[email protected] ~] #yum-y install httpd httpd-devel[email protected] ~]# systemctl start httpd[email protected] ~]# Systemctl enable httpdCentOS 7.x installation Mariadb database[email protected] ~]# yum-y install mariadb mariadb-server mariadb-libs mariadb-devel[ email protected] ~]# systemctl start mariadb [[email protected] ~]# Systemctl enable MARIADBDatabase security settings:[email protected] ~]# mysql_secure_installationLogin Database:[email protected] ~]# mysql-uroot-pcentos7.x installing PHP7 with Yum1. Installing Epel-releaseby command:yum-y Install Epel-releasesuccessfully installed. 2. Installing PHP7The terminal runs the following command again:RPM-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpm successfully acquires the PHP7 Yum Source, and then executes:yum-y Install php70wcentos7.x installing php7.2 with Yum1. If you have previously installed a lower version of PHP, first uninstall:[[email protected] ~] #yum-y remove php*2, because the Linux yum source does not exist php7.x, so we want to change the Yum sourceRPM-UVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm RPM-UVH https:// mirror.webtatic.com/yum/el7/webtatic-release.rpm 3, yum install php72w and various expansion modules, choose their own needs canyum-y Install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring PHP7 2w-mysqlnd Php72w-opcache php72w-pdo php72w-xml4, finally, write a PHP probe pointer, test PHP:[[email protected] ~] #cd/var/www/html/[[email protected] ~] #vi info.php<?phpphpinfo ();?>Save and exit5. Restart the Apache server:[email protected] ~]# systemctl restart httpd6. Visit http://localhost/info.php* Associate PHP with a database:[[email protected] ~] #yum Install Php-mysqlCentOS 7.x Installation phpMyAdmin1, install Epel First, otherwise the package will appear when installing Pgpmyadmin. [email protected] ~]# Yum install epel-release[email protected] ~]# RPM-IVH http://rpms.famillecollet.com/enterprise/remi-release-7.rpm 2, [[email protected] ~]# sudo yum install phpMyAdmin3. Open the PhpMyAdmin configuration file (path:/etc/httpd/conf.d/phpmyadmin.conf) with a text editor and locate and comment out the line of code with the word "Require IP XXXX". There will be lines of code like this, replaced with "Require all granted"[email protected] ~]# sudo vi/etc/httpd/conf.d/phpmyadmin.confModified file Content
- <Directory/usr/share/phpMyAdmin/>
- Adddefaultcharset UTF-8
- <ifmodule mod_authz_core.c>
- # Apache 2.4
- <RequireAny>
- # Require IP 127.0.0.1 #注释掉
- # Require IP:: 1 #注释掉
- Require all granted #新添加
- </RequireAny>
- </IfModule>
- <ifmodule!mod_authz_core.c>
- # Apache 2.2
- Order Deny,allow
- Deny from all
- Allow from 127.0.0.1
- Allow from:: 1
- </IfModule>
- </Directory>
- <Directory/usr/share/phpMyAdmin/setup/>
- <ifmodule mod_authz_core.c>
- # Apache 2.4
- <RequireAny>
- #Require IP 127.0.0.1 #注释掉
- #Require IP:: 1 #注释掉
- Require all granted #新添加
- </RequireAny>
- </IfModule>
- <ifmodule!mod_authz_core.c>
- # Apache 2.2
- Order Deny,allow
- Deny from all
- Allow from 127.0.0.1
- Allow from:: 1
- </IfModule>
- </Directory>
4, [[email protected] ~]# systemctl restart httpd
CentOS 7.x Installation Lamp