将libiconv-1.13.1.tar.gz上传至/software #tar zxf libiconv-1.13.1.tar.gz #cd libiconv-1.13.1
#./configure --prefix=/usr/local/ #make && make install #cd ..
将libmcrypt-2.5.8.tar.gz 上传至/software #tar zxf libmcrypt-2.5.8.tar.gz #cd libmcrypt-2.5.8 #./configure
#make && make install #/sbin/ldconfig #cd libltdl
#./configure --enable-ltdl-install #make && make install #cd ../../
将mhash-0.9.9.9.tar.gz上传至/software #tar zxf mhash-0.9.9.9.tar.gz #cd mhash-0.9.9.9/ #./configure
#make && make install
#cd ../
#ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la #ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so #ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4 #ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8 #ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a #ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la #ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so #ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2 #ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1 #ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
将mcrypt-2.6.8.tar.gz上传至/software #tar zxvf mcrypt-2.6.8.tar.gz #cd mcrypt-2.6.8/ #/sbin/ldconfig #./configure
#make && make install #cd ../
将php-5.4.3.tar.gz上传至/software
php5.3.3以后的版本源码不需要再打php-fpm补丁,该补丁已集成进php5.3.3, 在编译时,不需再–enable-fastcgi了,在php5.3.3中强制启用fastcgi了。 修复MySQL的BUG
# vi /usr/local/mysql/include/mysql/my_sys.h 找到
#include #include # vi /usr/local/mysql/include/mysql/m_string.h 找到 #include #include # vi /usr/local/mysql/include/mysql/plugin.h 找到 #include #include #cd php-5.4.3 #./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-sysvsem --enable-mbregex --enable-xml --disable-rpath --enable-bcmath --with-curl --enable-shmop --enable-inline-optimization --enable-fpm --with-curlwrappers --with-gd --enable-mbstring --with-mcrypt --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap #make ZEND_EXTRA_LIBS='-liconv' #make install #cp php.ini-production /usr/local/php/etc/php.ini #cd ../ 重命名php-fpm配置文件 #cd /usr/local/nginx/conf # cp php-fpm.conf.default php-fpm.conf 下面我们就要启动PHP-FPM #/usr/local/php/sbin/php-fpm 开机启动php-fpm #echo \"/usr/local/php/sbin/php-fpm\" >>/etc/rc.local 整合nginx与php #vi /usr/local/nginx/conf/nginx.conf 照下面图片改 改完后重启nginx #killall -9 nginx #/usr/local/nginx/sbin/nginx #cd /usr/local/nginx/html #vi test.php 输入以下内容: 在浏览器中访问: http://localhost/test.php 因篇幅问题不能全部显示,请点此查看更多更全内容