CentOS6安裝新版本PHP

配置yum源,追加CentOS 6.5的epel及remi源
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpmphp


如下是CentOS 7.0的源
yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpmmysql


使用yum list命令查看可安裝的包
yum list --enablerepo=remi --enablerepo=remi-php56 | grep phplinux


安裝PHP5.5的命令
yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64sql


yum源配置好了,下一步就安裝PHP5.6
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprofphp7


安裝PHP7的命令
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64ui


安裝PHP FPM
yum install php55w-fpm
yum install php56w-fpm
yum install php70w-fpmdebug


用PHP命令查看版本
php --version
PHP 5.6.24 (cli) (built: Jul 21 2016 07:42:08) pdo

相關文章
相關標籤/搜索