安装PHP
1、安装curl(支持https):
查看curl版本:curl -V
下载最新版本:https://curl.haxx.se/download/
wget https://curl.haxx.se/download/curl-7.70.0.tar.xz
tar -zxvf curl-7.70.0.tar.xz
./configure --prefix安装目录 --without-nss --with-ssl=/usr/local/ssl(openssl的安装目录) --with-gssapi --with-libmetalink --with-libssh2 --enable-tls-srp --enable-sspi
报错:
wget https://www.libssh2.org/download/libssh2-1.9.0.tar.gz
tar -zxvf libssh2-1.9.0.tar.gz
make && make install
2、安装php
cd /usr/local/src
获取比较新的PHP的yum源数据
yum -y install epel-release
//rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y update
查看可安装php版本:
yum list --enablerepo=webtatic | grep php
安装:
yum -y install php74(自行选择版本)
安装模块:(根据安装的版本,选择php的后缀)
yum -y install php74-php-bcmath php74-php-mbstring php74-php-xml php74-php-zip php74-php-mysqli php74-php-gd php74-php-json php74-php-mysqlnd php74-php-opcache php74-php-pdo php74-php-snmp php74-php-soap php74-php-sodium php74-php-process
yum -y install php74-php-pear.noarch php74-php-pecl-msgpack php74-php-pecl-msgpack-devel php74-php-pecl-swoole4 php74-php-pecl-yar php74-php-redis
Hyperf :Protobuf PHP 扩展 (如需要使用到 gRPC 服务端或客户端)
yum -y install hp74-php-pecl-protobuf
Error: Transaction check error:
file /usr/lib64/libzip.so.5 from install of libzip5-1.8.0-2.el7.remi.x86_64 conflicts with file from package libzip-1.5.1-2.module_el8.1.0+209+03b9a8ff.x86_64
rpm -e libzip-1.5.1-2.module_el8.1.0+209+03b9a8ff.x86_6 --nodeps
yum -y install php74-php-gd
安装phpize:(此为php的安装目录:/opt/remi/php74/root/usr/bin/)
yum -y install php74-php-devel
在安装扩展的./configure之前,执行/opt/remi/php74/root/usr/bin/phpize
安装php-fpm
yum -y install php74-php-fpm
php配置文件:/etc/opt/remi/php74/php.ini
php74 -v
启动php-fpm
#systemctl start php74-php-fpm
开机启动设置
#systemctl enable php74-php-fpm
#systemctl daemon-reload
systemctl restart php74-php-fpm
问题:php设置监听9000外的端口失败unable to bind listening socket for address ‘127.0.0.1:9003‘: Permission denied
