您的位置 首页 php

PHP 安装(CentOS) @20210213

该部分笔记整理:在 CentOS 中,使用 YUM 源安装 PHP 环境(包括 PHP-FPM 环境)的方法。

PHP 5.6 on CentOS 7.4

How to Install PHP 5.6 on CentOS 7

在 CentOS 7.4 上,默认 PHP 5.4 版本,现在需要使用 PHP 5.6 运行环境:

 ####### 添加 REMI 仓库

yum install -y 
yum install -y 

yum install -y yum-utils

####### 安装 PHP 5.6 环境

# 启用不同版本的 PHP 环境
# yum-config-manager --enable remi-php55 # [Install PHP 5.5]
# yum-config-manager --enable remi-php56 # [Install PHP 5.6]
# yum-config-manager --enable remi-php72 # [Install PHP 7.2]

yum-config-manager --enable remi-php56 # [Install PHP 5.6]
yum install -y php56 php56-php-fpm.x86_64

##### 验证版本

php -v

##### 以下是常用扩展(可选)

yum install -y php56-php-ldap.x86_64 php56-php-gd.x86_64 php56-php-mbstring.x86_64 \
    php56-php-bcmath.x86_64 php56-php-mysqlnd.x86_64

yum install -y php72-php-ldap.x86_64 php72-php-gd.x86_64 php72-php-mbstring.x86_64 \
php72-php-bcmath.x86_64 php72-php-mysqlnd.x86_64 php72-php-pdo.x86_64 \
php72-php-xml.x86_64 php72-php-pecl-zip.x86_64
  

注意事项:
1)通过该方法安装的 PHP 环境,配置文件位于 /opt/remi/php56/root/etc/ 目录

相关文章

「PHP」- 安装(Debian)

参考文献

How to Install PHP 5.6 on CentOS 7
php – Fatal error: Class ‘ZipArchive’ not found in – Stack Overflow

文章来源:智云一二三科技

文章标题:PHP 安装(CentOS) @20210213

文章地址:https://www.zhihuclub.com/148906.shtml

关于作者: 智云科技

热门文章

网站地图