系统:CentOS Linux release 7.3.1611内核:3.10.0-514.el7.x86_64PHP:php-5.3.27.tar.gz步骤:#yum install -y libxml2 libxml2-devel curl curl-devel freetype freetype-devel libpng libpng-devel libjpeg-dev...
系统:CentOS Linux release 7.3.1611
内核:3.10.0-514.el7.x86_64
PHP:php-5.3.27.tar.gz
步骤:
#yum install -y libxml2 libxml2-devel curl curl-devel freetype freetype-devel libpng libpng-devel libjpeg-devel openssl openssl-devel
下载php:
#wget http://am1.php.net/distributions/php-5.3.27.tar.gz
#cp php-5.3.27.tar.gz /usr/local/src
#cd /usr/local/src
#tar -zxvf php-5.3.27.tar.gz
#useradd -s /sbin/nologin php-fpm
#./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 \
--disable-ipv6 \
--with-pear \
--with-curl \
--with-openssl
#make
#make test
#make install
编辑配置文件:
#cd /usr/local/php/etc/
#cp php-fpm.conf.default php-fpm.conf
#vim /usr/local/php/etc/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
检查配置文件语法是否正确:
#/usr/local/php/sbin/php-fpm -t
出现NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful即成功
#cp /usr/local/src/php-5.3.27/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
#chmod 755 /etc/init.d/php-fpm
#chmod php-fpm on
启动php-fpm
#/etc/init.d/php-fpm start
查看进程:
#ps aux | grep php-fpm
至此,php编译安装完成。
本文标题为:CentOS7.3编译安装PHP
基础教程推荐
- laravel 解决多库下的DB::transaction()事务失效问题 2023-03-08
- php array分组,PHP中array数组的分组排序 2022-08-01
- 使用PHP开发留言板功能 2023-03-13
- PHP中的错误及其处理机制 2023-06-04
- PHP命名空间简单用法示例 2022-12-01
- PHP获取MySQL执行sql语句的查询时间方法 2022-11-09
- PHP实现Redis单据锁以及防止并发重复写入 2022-10-12
- thinkphp3.2.3框架动态切换多数据库的方法分析 2023-03-19
- 在Laravel中实现使用AJAX动态刷新部分页面 2023-03-02
- laravel ORM关联关系中的 with和whereHas用法 2023-03-02