部署系统环境:
安装epel仓库
yum -y install epel-release
安装软件源
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
或添加自建软件源:
创建一个软件源文件
vim /etc/yum.repos.d/myyum.repo
配置文件如下
[myyum]
name=myyum
baseurl=http://yum.zellzf.top
enabled=1
gpgcheck=0
gpgkey=http://yum.zellzf.top/RPM-GPG-KEY-TESTREPO
安装gcc编译环境
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel pcre pcre-devel
安装PHP7.2
yum install -y php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-opcache php72w-pdo php72w-xml php72w-mysql php72w-intl php72w-pear
安装PHP7.3
先安装remi软件源
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap php73-php-xml
为PHP添加smbclient拓展
yum install libsmbclient libsmbclient-devel -y
pecl install smbclient
执行完上面两条安装后为php启用该拓展
echo extension=smbclient.so >>/etc/php.ini
也可以直接在PHP配置文件最后添加extension=smbclient.so
重启PHP服务,使用命令检查是否有安装成功
php -m|grep smbclient
安装成功会返回以下结果
libsmbclient
smbclient
开启php服务
systemctl enable php-fpm.service
systemctl start php-fpm.service
暂无评论内容