CentOS - huyx/1 GitHub Wiki
yum install httpd php
参考: PHP 5.6 on CentOS/RHEL 7.2 and 6.7 via Yum
卸载刚刚安装的 PHP 5.4
yum list installed | grep php
yum erase php-cli.x86_64 php-common.x86_64 php.x86_64
添加 yum 库(Webtatic EL),注意要按顺序执行:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
安装 PHP 5.6 的 mod_php SAPI, 包括 opcode cache
yum install php56w php56w-opcache
也可以安装 php-fpm SAPI(包括 opcode cache)
yum install php56w-fpm php56w-opcache
软件包 | 作用 |
---|---|
php56w-pdo | PDO |
php56w-mysql | MySQL |
php56w-pecl-xdebug | Xdebug |
systemctl start httpd.service
systemctl stop httpd.service
systemctl restart httpd.service
systemctl reload httpd.service
<Directory "/var/www/html/api">
AllowOverride FileInfo
Require all granted
</Directory>
注意其中的 AllowOverride FileInfo