Installation Preparation Work
Yum Install-y apr-
gcc-libpcre-
pcre-openssl-*
Manual download of the installation is required because the version of Curl in the system package is not supported
wget https://curl.haxx.se/download/curl-7.59.0.tar.gz
TAR-XF curl-7.59.0.tar.gz
CD curl-7.59.0
./configure
Make && make install
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.3.tar.gz
TAR-XF libmcrypt-2.5.3.tar.gz
CD libmcrypt-2.5.3
./configure
Make && make install
wget http://mirrors.shu.edu.cn/apache//apr/apr-1.6.3.tar.gz
Mkdir/usr/local/apr
TAR-XF apr-1.6.3.tar.gz
CD apr-1.6.3
./configure--prefix=/USR/LOCAL/APR
Make && make install
wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
Mkdir/usr/local/apr-util
TAR-XF apr-util-1.6.1.tar.gz
CD apr-util-1.6.1
./configure--prefix=/usr/local/apr-util
Make && make install
Installing Apache
wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.29.tar.gz
TAR-XF httpd-2.4.29.tar.gz
MV Httpd-2.4.29 httpd
CD httpd
./configure--prefix=/usr/local/apache2/--with-apr=/usr/local/apr/--with-apr-util=/usr/local/apr-util/-- Enable-so--enable-deflate--enable-expires--enable-headers--enable-ssl--enable-rewrite--enable-mpms-shared=all- -with-mpm=prefork--enable-mods-shared=most
Make && make install
Install PHP
wget http://cn2.php.net/distributions/php-7.0.28.tar.gz
TAR-XF php-7.0.28.tar.gz
MV php-7.0.28 PHP
CD PHP
./configure--prefix=/usr/local/php/--with-apxs2=/usr/local/apache2/bin/apxs--enable-pdo--with-pdo-mysql-- With-mysql-sock--enable-xml--with-libxml-dir--enable-sockets--with-curl--with-gd--enable-gd-native-ttf-- With-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-mcrypt--with-openssl--with-mhash--enable-zip-- Enable-mbstring--enable-mbregex--with-iconv--enable-static
Make && make install
To modify the configuration:
Modify Apache httpd.conf
In line 195, remove the "#" modification to: ServerName localhost:80
Add index.php to line 253
DirectoryIndex index.php index.html
Add after 390 lines
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
Configure PHP Home index.php
Create index.php in/usr/local/apache2/htdocs
Vim index.php
Enter the following into the file
<?php
Phpinfio ();
?>
Save exit.
Start the httpd service
/usr/local/apache2/bin/apachectl start
PHP is ready to be configured.
Linux installation Apache 2.4.9+php 7.0.28