wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
yum install epel-release -y
====>查看依赖库
rpm -aq pcre pcre-devel openssl openssl-devel zlib-devel \
libxml2-devel libjpeg-turbo-devel libpng-devel libcurl-devel libxslt-devel \
freetype-devel gd-devel mhash mhash-devel mcrypt libmcrypt-devel
yum install pcre pcre-devel openssl openssl-devel zlib-devel \
libxml2-devel libjpeg-turbo-devel libpng-devel libcurl-devel libxslt-devel \
freetype-devel gd-devel mhash mhash-devel mcrypt libmcrypt-devel -y
=======>mhash、mhash-devel加密扩展库、mcrypt加密扩展库
mhash mhash-devel mcrypt libmcrypt-devel
2、====>安装 libiconv-devel库,需要第三方;
mkdir /home/tools/ -p
cd /home/tools/
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make && make install
cd ../
============LNMP==============================================
3、====>配合nginx安装PHP-5.3.27参数 ===> --with-mysql=mysqlnd \
cd /home/tools
rz php-5.3.27.tar.gz
tar zxf php-5.3.27.tar.gz
cd php-5.3.27/
./configure \
--prefix=/application/php-5.3.27 \
--with-mysql=/application/mysql \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp
=================================================================
==========先执行以下一种再make否则会报错=========================
ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/
touch ext/phar/phar.phar
=========================
echo "/application/mysql/lib" >>/etc/ld.so.conf
ldconfig
=================================================================
make && make install
ln -s /application/php-5.3.27/ /application/php
cp php-5.3.27/php.ini-production /application/php/lib/php.ini
=====>配置文件
[root@Lnmp tools]# ll php-5.3.27/php.ini*
-rw-r--r-- 1 101 101 69606 Jul 11 2013 php-5.3.27/php.ini-development ==>开发环境
-rw-r--r-- 1 101 101 69627 Jul 11 2013 php-5.3.27/php.ini-production ==>生产环境
=====>上传或修改配置文件
rz php-fpm.conf.5.3.27-cxybase
mv php-fpm.conf.5.3.27-cxybase /application/php/etc/php-fpm.conf
mkdir -p /app/logs
/application/php/sbin/php-fpm -t ====>检查语法
/application/php/sbin/php-fpm ====>启动PHP
netstat -lntup|grep php-fpm ====>查看服务进程
ps -ef|grep php-fpm|grep -v grep
=================================================================
开机自启动:
/application/php/sbin/php-fpm
/application/nginx/sbin/nginx
原文地址:http://blog.51cto.com/13196330/2048238