PHP 编译安装

时间:2023-03-08 20:04:49
PHP 编译安装
, 获取源码
wget -O php.tar.gz http://am1.php.net/get/php-5.6.27.tar.gz/from/this/mirror tar zxvf php.tar.gz cd php-5.6.27
2, 创建用户和组 groupadd php
useradd php -g php 3, 安装依赖 yum install libxml2-devel libcurl-devel libjpeg-turbo-devel libpng-devel freetype-devel openssl openssl-devel 4, 编译安装 ./configure --prefix=/usr/local/php --enable-opcache --enable-fpm --enable-sockets --enable-mysqlnd --with-fpm-user=php --with-fpm-group=php --with-pdo-mysql --with-gd --with-jpeg-dir=/usr/lib/ -with-freetype-dir=/usr/lib --with-curl --enable-mbstring --with-openssl --enable-bcmath
make && make install

5, 自启动脚本

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 6, 配置
phpconf.zip
复制到/usr/local/php/lib/php.ini
复制到/usr/local/php/etc/php-fpm.conf http://files.cnblogs.com/files/mysic/phpconf.zip