1)安装编译包
#yum -y install gcc gcc++ zlib zlib-devel apr*
2)编译安装apache
#wget http://www-eu.apache.org/dist/httpd/httpd-2.2.34.tar.gz
#tar -xzvf httpd-2.2.34.tar.gz
#cd httpd-2.2.34.tar.gz
#./configure -prefix=/usr/local/httpd/ --enable-ssl --enable-cgi --enable-mods-shared=allable-ssl --enable-cgi --enable-mods-shared=all --with-ssl=/usr/local/openssl/ --enable-track-vars --enable-rewrite
#make && make install
3)增加php网页设置,起服务
#vim /usr/local/httpd/conf/httpd.conf
找到:
#AddType application/x-gzip .gz .tgz
添加:
AddType application/x-httpd-php .php
找到:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
修改:
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
#/usr/local/httpd/bin/apachectl -k restart
#/usr/local/httpd/bin/apachectl或httpd -k start >> /etc/rc.local
#vim /usr/local/httpd/htdocs/1.php
<?php
echo "ok";
?>
4)补充:
bin程序命令 conf下配置文件 htdocs站点网页目录 logs默认日志
参考文档:http://www.jb51.net/article/59474.htm
1)安装编译包
#yum -y install apr autoconf automake gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel gd kernel keyutils patch perl kernel-headers compat mpfr cpp glibc libgomp libstdc++-devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm freetype libjpeg libpng php-common php-gd ncurses libtool* libxml2 libxml2-devel patch libxml2 libxml2-devel
2)编译安装php
#wget http://cn2.php.net/get/php-7.2.1.tar.gz/from/this/mirror -O php-7.2.1.tar.gz
#tar -xzvf php-7.2.1.tar.gz
#cd php-7.2.1
#./configure -prefix=/usr/local/php/ --with-apxs2=/usr/local/httpd/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-libxml-dir --with-zlib-dir --with-bz2 --with-openssl --enable-soap
#make && make install
#cp php.ini-production /usr/local/php/etc/php.ini
原文:http://blog.51cto.com/13571706/2064117