Centos7源码安装php7.3

安装依赖&&下载源码并安装

yum update -y 
yum install -y gcc gcc-c++ 

rpm -qa|grep libxml2
yum install -y libxml2-devel


yum install -y openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libxslt-devel libzip libzip-devel 
yum install bzip2 bzip2-devel -y 




https://www.php.net/downloads.php
wget https://www.php.net/distributions/php-7.3.11.tar.gz
./configure --prefix=/usr/local/php  --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-fpm

make -j2 
sudo make install 

配置php和php-fpm

1、先把源码包里的php.ini-development文件cp(复制)到php设置目录下改名为php.ini
由于我编译参数没有设置 参数:–with-config-file-path=php.ini目录
默认在:安装目录/lib/php.ini

2、到php目录的etc中:


[root@wf etc]# cp php-fpm.conf.default php-fpm.conf
[root@wf etc]# cp php-fpm.d/www.conf.default php-fpm.d/www.conf

3.vim /etc/profile 追加两行

export PATH=/usr/local/php/bin:$PATH
export PATH=/usr/local/php/sbin:$PATH

source /etc/profile
php-fpm -v
php -v

可能遇到的问题

configue时遇到:
configure: error: Please reinstall the BZip2 distribution:

yum install bzip2 bzip2-devel -y 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

InterestingFigure

迈克 Let's Go

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值