php5.4编译安装--nginx
2021-07-05 03:06
标签:源码 模块 kconfig enable mic config 网址 php.ini tar 1、下载源码包 php5.4编译安装--nginx 标签:源码 模块 kconfig enable mic config 网址 php.ini tar 原文地址:http://www.cnblogs.com/ddgen/p/7107292.html
wget 网址/源码包
2、解压源码包
tar -zxvf 源码包
3、创建一个安装目录
mkdir /usr/local/php
4、进入解压后的目录中,初始化安装环境
./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--enable-fpm \
--with-fpm-user=php-fpm \
--with-fpm-group=php-fpm \
--with-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 \
--enable-zend-multibyte \
--disable-ipv6 \
--with-pear \
--with-curl \
--with-openssl
错误
configure: error: jpeglib.h not found.
[root@www php-5.4.45]#
安装 yum install -y libjpeg-devel
错误
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
[root@www php-5.4.45]#
安装yum install -y epel-release libmcrypt-devel
5、编绎:make
6、安装:make install
/usr/local/php/bin/php -i 查看相关的配置
/usr/local/php/bin/php -m 查看支持的静态模块
7、拷贝配置文件,增加一个配置文件
cp php.ini-production /usr/local/php/etc/php.ini
vim /usr/local/php/etc/php-fpm.conf php-fpm.conf
内容如下:
[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
[www]
listen = /tmp/php-fcgi.sock
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
8、拷贝一个启动脚本
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
修改脚本的权限 chmod 755 /etc/init.d/php-fpm
创建用户php-fpm
useradd -s /sbin/nologin php-fpm
9、启动服务 service php-fpm start
查看服务是否开启:ps aux |grep php-fpm
查看端口是否启用:netstat -ltnp
10、让服务开机启动需要加入系统服务
chkconfig --add php-fpm
启用 chkconfig php-fpm on
重启使配置生效 service php-fpm restart
文章标题:php5.4编译安装--nginx
文章链接:http://soscw.com/index.php/essay/101963.html