升级 apache2.4.41-php5.6.40
因为低版本apache php报漏洞,之所以将apache php5升级到最新!
1.安装依赖
yum -y install gcc gcc-c++ autoconf automake make yum install gcc gcc-c++ autoconf automake make libjpeg libjpeg-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel libidn libidn-devel
apache版本2.4.41 php 版本5.6.40
安装依赖 yum install
tar包 apr-1.6.3 apr-util-1.6.1 apache2.4.41 php 5.6.40
将包都上传到 /opt
解压:
cd apr-1.6.3/
tar -xv apr-1.6.3
编译操作
./configure --prefix=/usr/local/aprr
make make install
解压
cd apr-util-1.6.1/
tar -xvf apr-util-1.6.1
编译操作
./configure --prefix=/usr/local/aprr-util --with-apr=/usr/local/aprr
make make install
apache 编译
./configure --prefix=/usr/local/apache2.4.41 --enable-cgi --with-apr=/usr/local/aprr --with-apr-util=/usr/local/aprr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=event --enable-cgi --enable-ssl --with-ssl=/usr/local/openssl
make make install
php编译
./configure --prefix=/usr/local/php5.6.40/ --with-config-file-path=/usr/local/php5.6.40/etc --enable-fpm --with-pear --with-curl --with-gd --with-jpeg-dir=/usr/local/jpeg --with-png-dir --with-freetype-dir=/usr/local/freetype --with-zlib-dir --with-iconv --enable-mbstring --enable-bcmath --with-mhash --with-zlib --with-xmlrpc --with-xsl --with-openssl --with-bz2 --with-gettext --with-xpm-dir=/usr/lib64/ --enable-sockets --with-apxs2=/usr/local/apache2.4.41/bin/apxs
make make install
检查是否有语法错误:/usr/local/apache2.4.41/bin/apachectl -t
启动apache服务
/usr/local/apache2.4.41/bin/apachectl