安装基础库请看这里
PHP(5.5.14)
安装libmcrypt
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz -P /usr/local/app/sources/
cd /usr/local/app/sources/
tar -xf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make && make install
php官网下载地址(http://php.net/releases/)
wget http://125.39.35.145/files/7192000006ABB044/sg2.php.net/distributions/php-5.5.14.tar.gz -P /usr/local/app/sources/
cd /usr/local/app/sources/
tar -xf php-5.5.14.tar.gz
编辑
vi /etc/ld.so.conf 加入/usr/local/lib
增加
/usr/local/lib
ldconfig
cd php-5.5.14
./configure --prefix=/usr/local/app/php --enable-fpm --with-iconv-dir --with-libxml-dir --enable-xml --with-gd --with-openssl --with-xmlrpc --enable-soap --enable-mbstring --enable-mbregex --with-mysql --with-mysqli --enable-pdo --with-zlib --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --with-mhash --with-mcrypt --enable-zip --with-pcre-regex --disable-fileinfo
make && make install clean
修改配置文件
cp php.ini-development /usr/local/app/php/lib/php.ini
cp /usr/local/app/php/etc/php-fpm.conf.default /usr/local/app/php/etc/php-fpm.conf
修改php扩展目录
vi /usr/local/app/php/lib/php.ini
增加一行extension_dir = "/usr/local/app/php/lib/php/extensions/no-debug-non-zts-20121212"
修改php启动的用户和组
vi /usr/local/app/php/etc/php-fpm.conf
修改user和group分别为www(否则nginx修改root后将没有权限访问php文件)启动php
/usr/local/app/php/sbin/php-fpm -y /usr/local/app/php/etc/php-fpm.conf -c /usr/local/app/php/lib/php.ini
启动nginx
/usr/local/app/nginx/sbin/nginx -c /usr/local/app/nginx/conf/nginx.conf
启动php-fpm
/usr/local/app/php/sbin/php-fpm -y /usr/local/app/php/etc/php-fpm.conf -c /usr/local/app/php/lib/php.ini
打开浏览器输入
http://ipaddr/index.php
测试