最後更新: 2019-04-16
目錄
用 remi 安 PHP
remi-safe 的包安裝在 /opt/remi/phpX
i.e.
/opt/remi/php73/
Centos 7 Install remi
yum install epel-release
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils # 獲得 yum-config-manager
# Single version (simplest way): remi-php73 repository
yum-config-manager --enable remi-php73
# Multiple versions simultaneously: remi-safe repository (enabled by default)
yum-config-manager --disable remi-safe
# Disable 其他不會用到的 Version ("yum list | grep ^php" 小許多)
yum-config-manager --disable remi-php71
yum-config-manager --disable remi-php72
yum-config-manager --disable remi-php74
# 用了 yum-config-manager 就不用 "--enablerepo=remi-php73"
yum --enablerepo=remi-php73 install \ php73-php-fpm php73-php-process \ php73-php-recode php73-php-intl php73-php-tidy php73-php-mbstring \ php73-php-mysqlnd php73-php-pdo \ # DB php73-php-bcmath php73-php-geos \ # other php73-php-xml php73-php-json php73-php-pecl-yaml \ # format php73-php-gd php73-php-pecl-imagick \ # image php73-php-pear \ # php73-php-pecl-apcu \ # pear php73-php-lz4 php73-php-pecl-zip # zip
Remark: 安一堆包
xargs -a php-package.txt yum install
# Checking
Modules
php73 --modules
FPM
# Config: /etc/opt/remi/php73/php-fpm.conf
systemctl enable php73-php-fpm
systemctl restart php73-php-fpm
# 127.0.0.1:9000
systemctl status php73-php-fpm
Centos 6 Install remi
Install epel-release
yum install yum-utils
yum install https://rpms.remirepo.net/enterprise/remi-release-6.rpm
remi-safe Usage
CLI
source /opt/remi/phpX/enable
Config Location
# php73 -i | grep php.ini
Configuration File (php.ini) Path => /etc/opt/remi/php73 Loaded Configuration File => /etc/opt/remi/php73/php.ini
Install Example
# php80
yum install php80 php80-php-fpm php80-php-cli php80-php-opcache \ php80-php-mysqlnd php80-php-pdo php80-libzip php80-php-lz4 \ php80-php-mbstring php80-php-gd php80-php-bcmath \ php80-php-soap php80-php-json php80-php-xml \ php80-php-intl php80-php-pspell php80-php-tidy \ php80-php-pear php80-php-pecl-yaml php80-php-pecl-zip \ php80-php-pecl-mcrypt php80-php-pecl-crypto php80-php-pecl-apcu yum install php80-php-pecl-imagick
Rocky8 Enable REMI
rpm -Uvh remi-release-8.rpm
dnf config-manager --enable remi
附加檔案 | 大小 |
---|---|
remi-release-7.rpm | 22.7 KB |
remi-release-8.rpm | 26.12 KB |