lnmp启动php,LNMP介绍及php的安装

和LAMP安装PHP方法有差别,需要开启php-fpm服务

如果安装过以前php需要make clean

root@aminglinux-02 php-5.6.30]# make clean

find . -name \*.gcno -o -name \*.gcda | xargs rm -f

find . -name \*.lo -o -name \*.o | xargs rm -f

find . -name \*.la -o -name \*.a | xargs rm -f

find . -name \*.so | xargs rm -f

find . -name .libs -a -type d|xargs rm -rf

rm -f libphp5.la sapi/cli/php sapi/cgi/php-cgi libphp5.la modules/* libs/*

cd /usr/local/src/

tar zxf php-5.6.30.tar.gz

useradd -s /sbin/nologin php-fpm 该账号用来运行php-fpm服务

cd php-5.6.30

./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl

错误

configure: error: Please reinstall the libcurl distribution -

easy.h should be in /include/curl/

[root@aminglinux-02 php-5.6.30]# yum list |grep libcurl

libcurl.x86_64 7.29.0-35.el7.centos @anaconda

libcurl.i686 7.29.0-35.el7.centos base

libcurl-devel.i686 7.29.0-35.el7.centos base

libcurl-devel.x86_64 7.29.0-35.el7.centos base

[root@aminglinux-02 php-5.6.30]# yum install -y libcurl-devel

make & make install

php-fpm加载模块查看命令

[root@aminglinux-02 php-5.6.30]# /usr/local/php-fpm/sbin/php-fpm -m

[root@aminglinux-02 php-5.6.30]# /usr/local/php-fpm/bin/php -m

php-fpm配置文件语法检测命令

[root@aminglinux-02 php-5.6.30]# /usr/local/php-fpm/sbin/php-fpm -t

cp php.ini-production /usr/local/php-fpm/etc/php.ini拷贝php配置文件

vi /usr/local/php/etc/php-fpm.conf 编辑php-fpm配置文件写入

[global]

pid = /usr/local/php-fpm/var/run/php-fpm.pid

error_log = /usr/local/php-fpm/var/log/php-fpm.log

[www]

listen = /tmp/php-fcgi.sock

#listen = 127.0.0.1:9000

listen.mode = 666

user = php-fpm

group = php-fpm

pm = dynamic

pm.max_children = 50

pm.start_servers = 20

pm.min_spare_servers = 5

pm.max_spare_servers = 35

pm.max_requests = 500

rlimit_files = 1024

[global]定义全局参数,listen定义监听地址,也可以写成ip加端口,listen.mode只有监听为socket时才生效,用来指定sock文件的权限

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 启动文件

chmod 755 /etc/init.d/php-fpm

chkconfig --add php-fpm

chkconfig php-fpm on

service php-fpm start

ps aux |grep php-fpm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值