First, install Apache HTTP service
1, download the HTTP required package, in the Apache source file Read.cmake can see the dependency, as long as the download corresponding version of the line
Apr-1.5.2.tar.gz Https://pan.baidu.com/s/11PUxyiZ92mrMbhF9z2ktBQ apr-util-1.5.2.tar.gz https://pan.baidu.com/s/1mIQPb7fyi3TzP_6Wfb_nGg |
2. Install Apache HTTP Service
Download httpd-2.4.33 Package and unzip it (I unzip it to/root)
| CP apr-1.5.2/*/root/httpd-2.4.33/srclib/ CP apr-util-1.5.2/*/root/httpd-2.4.33/srclib/apr-util CD httpd-2.4.33 ./configure-prefix=/usr/local/http Do && make install//No error indication installation is successful, you can also see if/usr/local/http has generated two, install PHP service |
Second, PHP installation
1. Install dependent software
Yum-y Install OpenSSL
Yum-y Install Openssl-devel
Yum-y Install Curl
Yum-y Install Curl-devel
Yum-y Install Libjpeg
Yum-y Install Libjpeg-devel
Yum-y Install libpng
Yum-y Install Libpng-devel
Yum-y Install FreeType
Yum-y Install Freetype-devel
Yum-y Install Pcre
Yum-y Install Pcre-devel
Yum-y Install Libxslt
Yum-y Install Libxslt-devel
Yum-y Install bzip2
Yum-y Install Bzip2-devel
2. Install PHP Service
Download the php-7.2.4 package and unzip the website
CD php-7.2.4 ./configure--prefix=/usr /local/php --with-apxs2=/usr/local/http/bin/apxs --enable-mysqlnd \--with-mysqli -- With-pdo-mysql --with-curl--with-freetype-dir --with-gd--with-gettext--with-iconv-dir -- With-kerberos--with-libdir=lib64--with-libxml-dir --with-mysqli--with-openssl--with-pcre-regex-- With-pdo-mysql--with-pdo-sqlite--with-pear--with-png-dir --with-jpeg-dir --with-xmlrpc--with-xsl-- With-zlib--with-bz2--with-mhash--enable-fpm--enable-bcmath--enable-libxml--enable-inline-optimization-- Enable-gd-native-ttf--enable-mbregex--enable-mbstring--enable-opcache--enable-pcntl--enable-shmop--enable-soap --enable-sockets--enable-sysvsem--enable-sysvshm--enable-xml--enable-zip |
Description:--with-apxs2=/usr/local/http/bin/apxs This option to generate a PHP module file libphp7in the HTTP Module directory. so
3. Configuration modification
Because I was used as a phpmyadmin, I changed the PHP restrictions on uploading, as follows:
CP Php.ini-development/usr/local/php/lib/php.ini//php.ini-development in the root directory of the source package Vim/usr/local/php/lib/php.ini//modify File Upload size Post_max_size = 200M Upload_max_filesize = 200M |
Third, configure HTTP
Configuration file:/usr/local/http/conf/httpd.conf
Add at LoadModule
LoadModule php7_module MODULES/LIBPHP7 . so
Add at the end
<filesmatch \.php$> SetHandlerapplication/x-httpd-php
</FilesMatch>
Modify the following (increase Apache type find file index.php)
<ifmodule dir_module>
DirectoryIndex index.html index.php
</IfModule>
Other configuration changes such as service access ports are not explained here
Iv. launch of Apache
/usr/local/http/bin/apachectl-k start
Apache PHP7 Installation