1. 程式人生 > >各大源碼包安裝

各大源碼包安裝

源碼編譯安裝 gzip all href amp water 51cto cal .tar.gz

1、apache源碼編譯安裝

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

2、php源碼編譯安裝

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

各大源碼包安裝