tar -zxvf libmcrypt-2.5.8.tar.gz -C /usr/src
tar -zxvf mhash-0.9.9.9.tar.gz -C /usr/src
tar -zxvf mcrypt-2.6.8.tar.gz -C /usr/src
tar -zxvf php-5.3.28.tar.gz -C /usr/src
tar -zxvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz -C /usr/src
cd /usr/src/libmcrypt-2.5.8/
./configure && make && make install
创建软链接
ln -s /usr/local/lib/libmcrypt.* /usr/lib
cd /usr/src/mhash-0.9.9.9/
./configure && make && make install
创建软链接
ln -s /usr/local/lib/libmhash.* /usr/lib
修改环境变量路径:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
编译安装
cd /usr/src/libmcrypt-2.6.8/
./configure && make && make install
安装install libxml2*
yum -y install libxml2*
编译安装
cd /usr/src/php-5.3.28/
./configure --prefix=/usr/local/php --with-mcrypt --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php --enable-mbstring
make && make install
编辑配置文件php.ini
cp /usr/src/php-5.3.28/php.ini-development /usr/local/php/php.ini
vim /usr/local/php/php.ini
修改字符集
;default_charset = "utf-8"
开启PHP默认路径和目录设置函数enable_dl
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = On
复制文件
cd /usr/src/ZendGuardLoader-php-5.3-linux-glibc23-x86_64/
cp php-5.3.x/ZendGuardLoader.so /usr/local/php/lib/php/
编辑配置文件php.ini,最后一行添加:
zend_extension=/usr/local/php5/lib/php/ZenGuardLoader.so
zend_loader.enable=1
vim /usr/local/httpd/conf/httpd.conf
<IfModule dir_module>
DirectoryIndex ndex.php index.html
</IfModule>
在AddType这一行添加以下内容:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
service httpd restart
netstat -anpt | grep httpd
tcp 0 0 :::80 :::*
LISTEN 45370/httpd
cd /usr/local//httpd/htdocs/
mv index.html index.bak
vim index.php
添加以下信息:
<?php
phpinfo();
?>