yum安装php

 

标准解决方案:centos7+php7.4

#!/bin/bash

yum -y update
yum install epel-release
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils

yum search php74
yum install -y php74 #cli,common,json,runtime

#php74-php-devel.x86_64 : Files needed for building PHP extensions
#php74-php-pear.noarch : PHP Extension and Application Repository framework
yum install -y php74-php-devel
#php74 -m
yum install -y php74-php-pear #process,xml
#php74-pear config-get php_dir
#php74 -m
yum install -y php74-php-gd php74-php-mbstring php74-php-fpm php74-php-pdo php74-php-mysqlnd
yum install -y php74-php-pecl-swoole4
yum install -y php74-php-pecl-redis4 php74-php-pecl-mongodb 
yum install -y php74-php-bcmath php74-php-sodium

 

yum安装swoole

4、安装pecl
yum -y install php72w-devel
yum -y install php72w-pear

5、安装swoole(确认gcc编译器已安装,如果没有运行 yum install gcc*)
pecl install swoole

6、加入PHP扩展
vim /etc/php.ini
最后面添加 extension=swoole.so
通过 php -m 可查看是否安装成功

7、安装中出现的问题,解决方案
https://wiki.swoole.com/wiki/page/1013.html
posted @ 2020-02-25 20:32  小匡程序员  阅读(1503)  评论(0编辑  收藏  举报