码迷,mamicode.com
首页 > Web开发 > 详细

第一节 php环境搭建与优化

时间:2018-12-20 22:16:05      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:figure   reg   string   inf   math   libjpeg   ber   path   enable   

一 php安装
方法1 源码安装(jweb1,jweb2)

yum -y install libxml2
yum -y install libxml2-devel
yum -y install openssl
yum -y install openssl-devel
yum -y install curl
yum -y install curl-devel
yum -y install libjpeg
yum -y install libjpeg-devel
yum -y install libpng
yum -y install libpng-devel
yum -y install freetype
yum -y install freetype-devel
yum -y install pcre
yum -y install pcre-devel
yum -y install libxslt
yum -y install libxslt-devel
yum -y install bzip2
yum -y install bzip2-devel
[root@jweb-1 php-5.6.38]# useradd -s /sbin/nologin nginx
[root@jweb-1 php-5.6.38]# ./configure --prefix=/usr/local/php --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip
[root@jweb-1 php-5.6.38]# make && make install
[root@jweb-1 php-5.6.38]# cp php.ini-development /usr/local/php/lib/php.ini
[root@jweb-1 php-5.6.38]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
 [root@jweb-1 php-5.6.38]#vim /usr/local/php/lib/php.ini 
 772 cgi.fix_pathinfo=0
[root@jweb-1 php-5.6.38]# vim /usr/local/php/etc/php-fpm.conf
149 user = nginx
150 group = nginx
[root@jweb-1 php-5.6.38]# vim /etc/profile
 77 export PATH=/usr/local/php/bin/:$PATH
[root@jweb-1 php-5.6.38]# php-fpm
[root@jweb-1 php-5.6.38]# ss -tunlp | grep 9000
tcp    LISTEN     0      128    127.0.0.1:9000                  *:*                   users:(("php-fpm",pid=1047,fd=0),("php-fpm",pid=1046,fd=0),("php-fpm",pid=1045,fd=7))
[root@jweb-1 php-5.6.38]# vim /etc/rc.local
/usr/local/bin/php-fpm
[root@jweb-1 php-5.6.38]# chmod +x /etc/rc.local

二 安装php支持redis模块

[root@jweb-1 phpredis-2.2.4]# ls /usr/local/php/bin/php-config 
/usr/local/php/bin/php-config
[root@jweb-1 phpredis-2.2.4]# ./configure --with-php-config=/usr/local/php/bin/php-config
[root@jweb-1 phpredis-2.2.4]# make && make install
[root@jweb-1 phpredis-2.2.4]# ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
opcache.a  opcache.so  redis.so
[root@jweb-1 phpredis-2.2.4]# vim /usr/local/php/lib/php.ini 
 733 extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-2013122     6/"
 734 extension = "redis.so"
[root@jweb-1 ~]# php -m | grep redis
redis

三 php参数优化
优化参数参考:http://blog.51cto.com/11233559/2124007

第一节 php环境搭建与优化

标签:figure   reg   string   inf   math   libjpeg   ber   path   enable   

原文地址:http://blog.51cto.com/14050800/2333606

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!