yum install -y oniguruma gd libzip yum-utils
nginx
添加nginx源
/etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/8/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/8/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
yum install -y nginx
php基础环境
yum install -y php php-common php-cli php-devel
yum install -y php-mbstring php-process php-json php-xml php-pear php-bcmath php-opcache php-gd
yum install -y php-pdo php-mysqlnd php-pgsql php-odbc
yum install -y php-pecl-zip
Firebird支持
yum install -y libfbclient2 libfbclient2-devel libib-util libtommath perl-DBD-Firebird
nginx配置
fastcgi_pass unix:/run/php-fpm/www.sock;
Hyperf 环境要求
PHP >= 7.4
以下任一网络引擎
Swoole PHP 扩展 >= 4.5,并关闭了 Short Name
Swow PHP 扩展 (Beta)
JSON PHP 扩展
Pcntl PHP 扩展
OpenSSL PHP 扩展(如需要使用到 HTTPS)
PDO PHP 扩展 (如需要使用到 MySQL 客户端)
Redis PHP 扩展 (如需要使用到 Redis 客户端)
Protobuf PHP 扩展 (如需要使用到 gRPC 服务端或客户端)
安装php扩展
官网http://php.net/releases/ 下载对应的安装包
php -v
检查php配置路径
whereis php-config
Pcntl PHP 扩展
cd php-7.4.6/ext/
pcntl
cd pcntl/
/usr/bin/phpize
./configure –with-php-config=/usr/bin/php-config
注意/usr/bin/php-config
检查php配置路径
whereis php-config
make && make install
Redis PHP 扩展 (如需要使用到 Redis 客户端)
wget https://pecl.php.net/get/redis-5.3.6.tgz
cd redis-5.3.6/
/usr/bin/phpize
./configure –with-php-config=/usr/bin/php-config
make && make install
Protobuf PHP 扩展
yum install -y protobuf.x86_64 protobuf-compiler.x86_64 protobuf-devel.x86_64
wget https://github.com/allegro/php-protobuf/archive/refs/heads/master.zip
/usr/bin/phpize
./configure –with-php-config=/usr/bin/php-config
make && make install
Swoole PHP 扩展
wget https://pecl.php.net/get/swoole-4.8.6.tgz
/usr/bin/phpize
./configure –with-php-config=/usr/bin/php-config
make && make install
; Enable swoole extension module
extension=swoole.so
swoole.use_shortname = off ;关闭 Short Name
Installing shared extensions: /usr/lib64/php/modules/
添加相应的配置
/etc/php.d/
cat 20-protobuf.ini
; Enable protobuf extension module
extension=protobuf
rename’.repo”.repo.bak’ /etc/yum.repos.d/*.repo