环境
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