标签:LNMP php安装 lnmp下php安装
LNMP构架-简介与php安装(与lamp不同)简介:
LNMP=Linux+nginx+MySQL+php
和LAMP安装PHP方法有差别,需要开启php-fpm服务,需要添加php-fpm用户
清空之前编译过的php配置(安装过php的)
cd /usr/local/src/php-5.6.30
make clean
cd /usr/local/src/
wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
tar zxvf php-5.6.30.tar.gz
useradd -s /sbin/nologin php-fpm
cd /usr/local/src/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
make && make install
cp /usr/local/src/php-5.6.30/php.ini-production /usr/local/php-fpm/etc/php.ini
cd /usr/local/php-fpm/etc/
vim php-fpm.conf
增加代码
[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
cd /usr/local/src/php-5.6.30/
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig --list
/usr/local/php-fpm/sbin/php-fpm -t
service php-fpm start
ps aux |grep php-fpm
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
搜索curl,相应的包yum list |grep -i curl
选着devel的包安装
yum install -y libcurl-devel
标签:LNMP php安装 lnmp下php安装
原文地址:http://blog.51cto.com/shuzonglu/2085780