centos 7.4 源码安装php5.6

1.下载php-5.6.36.tar.gz

2.解压

    tar -zxvf php-5.6.36.tar.gz

3.进入php目录 

    cd php-5.6.36

4.执行configure

./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=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-freetype-dir --with-png-dir --with-iconv-dir --with-zlib-dir --with-mcryp --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-pear --with-curl --with-openssl

报错xml2-config not found. Please check your libxml2 installation

安装xml2

yum install libxml2

yum install libxml2-devel -y

报错Please reinstall the libcurl distribution -easy.h should be in <curl-dir>/include/curl/

yum -y install curl-devel

报错png.h not found.

yum install libpng-devel

报错freetype-config not found

yum install freetype-devel

5.make && make install

6.复制php.ini配置文件到指定目录 

cp php.ini-development /usr/local/php/etc/php.ini  
cd /usr/local/php/etc  

cp ./php-fpm.conf.default ./php-fpm.conf

7.设置软连接

ln -sf /usr/local/php/sbin/php-fpm /usr/bin/php

8.添加www用户和组

groupadd www

useradd -g www www

9.编辑php-fpm.conf文件,将user和group设置为www

; Unix user/group of processes

; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
user = www

group = www

10.启动php服务

cd /usr/local/php/sbin

./php-fpm








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值