#先安裝需要的庫
yum -y install libxml2
yum -y install libxml2-devel
yum -y install gd
yum -y install gd-devel
yum -y install curl curl-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel
yum -y install freetype freetype-devel
yum -y install openldap
yum -y install openldap-devel
cp /home/root/php-5.2.17.tar.gz /usr/local/src
cd /usr/local/src
tar xzvf php-5.2.17.tar.gz
./configure --prefix=/usr/local/php5 \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-libxml-dir=/usr/local/lib \
--with-gd \
--with-jpeg-dir=/usr/local/jpeg6 \
--with-zlib \
--with-curl \
--with-ldap \
--with-gettext \
--with-iconv \
--enable-mbstring \
--enable-soap \
--with-png-dir=/usr/local/libpng2 \
--with-freetype-dir=/usr/local/freetype \
--with-xmlrpc \
--with-config-file-path=/usr/local/php5/etc
make
make install
cp /usr/local/src/php.ini-dist /usr/local/php5/etc/php.ini
配置
vi /usr/local/apache2/conf/httpd.conf
#directoryindex index.html後增加index.php
directoryindex index.html index.php
#中增加:
/usr/local/apache2/bin/apachectl restart
#若遇到錯誤如:/usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: permission denied
#解決辦法:
setenforce 0
chcon -c -v -r -u system_u -r object_r -t textrel_shlib_t /usr/local/apache2/modules/libphp5.so
/usr/local/apache2/bin/apachectl restart
setenforce 1
/usr/local/apache2/bin/apachectl restart
CentOS 原始碼安裝PHP
2 解壓縮並且進入解壓縮後的檔案目錄下 4 make make install 遇到問題 1 configure error xml2 config not found.please check your libxml2 installation 參看 安裝php時的報錯 checking libx...
centos下php原始碼安裝
解壓 tar xjvf gz檔案 xjvf bz2檔案 進入解壓後目錄 安裝必須工具yum y install libxml2yum y install libxml2 develyum install sqlite devel配置.configure prefix 自定義安裝目錄 with zli...
CentOS以原始碼方式安裝PHP
系統環境 centos 6.5 64位 nginx 1.6.2 mysql 5.6.23 php 5.6.6 依賴庫 為了省事,直接用yum來安裝吧 yum y install libmcrypt devel libxml2 devel curl devel libjpeg devel libpng...