php7 源码保护,php7 源码安装

本文详细描述了在安装PHP过程中遇到的Oniguruma包缺失问题,提供了两种方法:通过yum安装Remi仓库的版本,以及从源代码编译安装。同时介绍了如何配置php-fpm和PECL安装,以及修改php.ini文件。
摘要由CSDN通过智能技术生成

环境

yum -y install libxml2

yum -y install libxml2-devel

yum install -y sqlite-devel

yum install libcurl-dev libcurl-devel

tar -zxvf php-7.4.9.tar.gz

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli

--with-openssl --with-pdo-mysql --enable-fpm --enable-session --with-curl --enable-mbstring

make && make install

配置

cp php.ini-production /usr/local/php/etc/php.ini

PATH=$PATH:/usr/local/mysql/bin:/usr/local/php/bin

PATH=$PATH:/usr/local/mongodb/bin

export PATH

mbstring 安装

cd php-5.6.30/ext/mbstring

/usr/local/php/bin/phpize

./configure --with-mbstring=/usr/local/mbstring --with-php-config=/usr/local/php/bin/php-config

make

sudo make install

vi /usr/local/php/etc/php.ini

extension=mbstring.so

(1) 问题:No package 'oniguruma' found

https://github.com/kkos/oniguruma

// 1. 方法一

yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.5+rev1-2.el7.remi.x86_64.rpm

yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.5+rev1-3.el7.remi.x86_64.rpm

yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.5+rev1-2.el7.remi.x86_64.rpm

yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.5+rev1-3.el7.remi.x86_64.rpm

// 2. 方法

wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz

tar -zxvf oniguruma-6.9.4.tar.gzcd oniguruma-6.9.4/

./autogen.sh

./configure

make

make install

配置php-fpm服务

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

cp etc/php-fpm.d/www.conf.default www.conf

vim php-fpm.conf

pid = run/php-fpm.pid

error_log = log/php-fpm.log

log_level = warning

daemonize = yes #作为守护进程运行php-fom。默认值为yes。

vim www.conf

user = nginx

group = nginx

listen.owner = nginx

listen.group = nginx

// 启动php-fpm

./sbin/php-fpm

pecl 安装

$ wget http://pear.php.net/go-pear.phar

$ php go-pear.phar

pecl channel-update pecl.php.net

yum install m4 autoconf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值