1.源码编译安装php
yum install libxml2-devel openssl-devel bzip2-devel -y
cd /usr/local/src tar zxvf php-5.4.13.tar.gz cd /usr/local/src/php-5.4.13 ./configure \ --prefix=/usr/local/php \ --enable-fpm \ --with-openssl \ --enable-mbstring \ --enable-sysvshm \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --with-bz2 --with-curl \ --enable-sockets \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib-dir \ --with-libxml-dir=/usr \ --enable-xml \ --with-mysql \ --with-mysqli make make test make install
2.为php提供配置文件:
cp php.ini-production /etc/php.ini
(1)为php-fpm提供Sysv init脚本,并将其添加至服务列表:
cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm chmod +x /etc/rc.d/init.d/php-fpm chkconfig --add php-fpm chkconfig php-fpm on
(2)为php-fpm提供配置文件:
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
(3)编辑php-fpm的配置文件:
vim /usr/local/php/etc/php-fpm.conf 配置fpm的相关选项为你所需要的值,并启用pid文件(如下最后一行):
pm.max_children = 150 pm.start_servers = 8 pm.min_spare_servers = 5 pm.max_spare_servers = 10 pid = /usr/local/php/var/run/php-fpm.pid
3.启动php-fpm
service php-fpm start
4.查看php-fpm后台进行
ps aux | grep php-fpm | grep -v "grep"
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。