安装lib库
yum install zlib-devel libxml2-devel libjpeg-turbo-devel freetype-devel libpng-devel gd-devel -y
下载libiconv包
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz tar xf libiconv-1.14.tar.gz cd libconv-1.14 ./configure --prefix=/usr/local/libiconv make make install
设置epel源
wget -O /etc/yum.repos.d/epel.repo
安装libmcrypt库、安装加密扩展库mhash、安装mcrypt扩展库、安装libxstl-devel
yum install libmcrypt libmcrypt-devel mhash mhash-devel mcrypt libxstl-devel -y
PHP编译指令
./configure \ --prefix=/application/php5.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 make make install
创建PHP的软连接
ln -s /application/php.5.3.27 /application/php
配置PHP.INI文件(从安装目录中复制ini文件模版。结尾是development是用于开发的,production是用于生产环境的)
cd ~/php.5.3.27 cp php.ini-production /application/php/lib/php.ini
配置PHP服务(fastcgi模式)配置文件php-fpm.conf
cd /application/php/etc cp php-fpm.conf.default php-fpm.conf
修改必要的参数后启动php-fpm
/application/php/sbin/php-fpm
检查启动的进程(一个主进程,16个子进程,在php-frm.conf中配置)
ps -ef|grep php-fpm|grep -v grep #查看进程 ps -ef|grep php-fpm|grep -v grep|wc -l #检查进程数
查看端口(端口默认9000)
netstat -lntup|grep php-fpm ss -lntup|grep php-fpm
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。