1. 程式人生 > >lnmp中php的安裝

lnmp中php的安裝

lnmp php 搭建

#cd /usr/local/src //進入src目錄


#wget http://cn2.php.net/distributions/php-5.6.30.tar.gz //下載


#tar zxf php-5.6.30.tar.gz //解壓縮


#cd php-5.6.30/ //進入php的目錄


#./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


#/usr/local/php-fpm/sbin/php-fpm -m //查看模塊


#/usr/local/php-fpm/sbin/php-fpm -i

#/usr/local/php-fpm/sbin/php-fpm -t //檢查語法錯誤


#cp php.ini-production /usr/local/php-fpm/etc/php.ini //拷貝php的配置文件(適合生產環境)


#vim /usr/local/php-fpm/etc/php-fpm.conf //編輯php-fpm服務的配置文件內容

[global] //定義全局參數

pid = /usr/local/php-fpm/var/run/php-fpm.pid //定義它的pid

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

[www] //模塊名

listen = /tmp/php-fcgi.sock //監聽

#listen = 127.0.0.1:9000

//監聽本機ip和端口

listen.mode = 666 //監聽權限,只有監聽socket時才會生效

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


#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 //啟動php-fpm


lnmp中php的安裝