安装php7.4
cat /etc/redhat-release
yum install epel-release
rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y yum-utils
yum-config-manager --enable remi-php74
yum install -y php php-fpm php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-redis php-opcache php-devel curl-devel
安装composer
php -r "readfile('https://getcomposer.org/installer');" | php
mv composer.phar /usr/bin/composer
composer -v
安装swoole4.8.10扩展
pecl install -D 'enable-sockets="no" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="no" enable-swoole-curl="yes" enable-cares="yes"' http://pecl.php.net/get/swoole-4.8.10.tgz
# /etc/php.ini添加扩展
extension=swoole.so
# 关闭short name
swoole.use_shortname=Off
安装swoole常见问题
如果启用sockets、mysqlnd、swoole-curl时,需要先删除/etc/php.d/里面对应的配置20-sockets.ini、20-mysqlnd.ini、20-curl.ini,然后再在/etc/php.ini里面添加如下配置
extension=curl.so
extension=mysqlnd.so
extension=sockets.so
标签:enable,swoole,mysqlnd,centos7.9,Hyperf,curl,php,安装,yes
From: https://www.cnblogs.com/fengchi/p/18329666