PHP企业实战安装步骤
安装lib库
成都创新互联公司主要从事成都网站设计、成都做网站、网页设计、企业做网站、公司建网站等业务。立足成都服务邹平,10余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:13518219792
yum install zlib-devel libxml2-devel libjpeg-turbo-devel freetype-devel libpng-devel gd-devel -y
下载libiconv包
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz tar xf libiconv-1.14.tar.gz cd libconv-1.14 ./configure --prefix=/usr/local/libiconv make make install
设置epel源
wget -O /etc/yum.repos.d/epel.repo
安装libmcrypt库、安装加密扩展库mhash、安装mcrypt扩展库、安装libxstl-devel
yum install libmcrypt libmcrypt-devel mhash mhash-devel mcrypt libxstl-devel -y
PHP编译指令
./configure \ --prefix=/application/php5.3.27 \ --with-MySQL=/application/mysql \ --with-iconv-dir=/usr/local/libiconv \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib \ --with-libxml-dir=/usr --enable-xml \ --disable-rpath \ --enable-safe-mode \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --with-curlwrappers \ --enable-mbregex \ --enable-fpm \ --enable-mbstring \ --with-mcrypt \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --enable-short-tags \ --enable-zend-multibyte \ --enable-static \ --with-xsl \ --with-fpm-user=nginx \ --with-fpm-group=nginx \ --enable-ftp
在Make之前创建软连接,否则可能报错
ln -s /application/mysql/lib//libmysqlclient.so.18 /usr/lib64 make make install
创建PHP的软连接
ln -s /application/php.5.3.27 /application/php
配置PHP.INI文件(从安装目录中复制ini文件模版。结尾是development是用于开发的,production是用于生产环境的)
cd ~/php.5.3.27 cp php.ini-production /application/php/lib/php.ini
配置PHP服务(fastcgi模式)配置文件php-fpm.conf
cd /application/php/etc cp php-fpm.conf.default php-fpm.conf
修改必要的参数后启动php-fpm
/application/php/sbin/php-fpm
检查启动的进程(一个主进程,16个子进程,在php-frm.conf中配置)
ps -ef|grep php-fpm|grep -v grep #查看进程 ps -ef|grep php-fpm|grep -v grep|wc -l #检查进程数
查看端口(端口默认9000)
netstat -lntup|grep php-fpm ss -lntup|grep php-fpm
当前名称:PHP企业实战安装步骤
本文来源:http://pwwzsj.com/article/isjigs.html