Install the Apache environment first and install it directly with Yum
Yum install httpd httpd-devel/etc/httpd/# launch Apache# stop Apache # Restart Apache
Then install MySQL (mariadb)
Yum install mariadb mariadb-/usr/share/mysql/my-huge.cnf/etc//etc/my.cnf# log-slow-queries=/var/log/mariadb/slow.loglong_query_time=1log-queries-not- using-#(change password, if there is a password may be root1234)
After the installation of these two environments, the source is now installed PHP7.2.8
# download image files wget http://hk1.php.net/get/php-7.2.8.tar.gz/from/this/Mirror tar zxvf mirrorcd php-7.2.8 # If this is a new environment, you need to install some dependent yum install autoconf gcc httpd-devel libxml2 libxml2-* openssl.x86_64 openssl-devel.x86_64 libcurl.x86_64 libcurl-devel.x86_64 libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 libjpeg-turbo-devel-y. /configure--with-mysqli--with-curl--with-apxs2=/usr/bin/apxs--with-openssl--enable-mbstring--WITH-GD-- Enable-gd-native-ttf--enable-gd-jis-conv--with-jpeg-dir--with-config-file-path=/etc/ && make Install
After you configure the Apache configuration file
vi/etc/httpd/conf/httpd.conf # Span style= "COLOR: #008000" > find loadmodule about 54 rows, under Comments, add the following configuration # php.ini directory phpinidir/etcloadmodule php7_module / Usr/lib64/httpd/modules/libphp7.so # Span style= "COLOR: #008000" > parse. php file <filesmatch " \.php$ " > SetHandler Application /x-httpd-PHP< /filesmatch> <ifmodule dir_module > DirectoryIndex index.php index.html< /ifmodule>addtype application /x-httpd-php. PHP
Then restart Apache to use it.
Systemctl Restart Httpd.service
Source installation CentOs7 under the PHP7