標籤:centos7安裝php5.6
配置yum源:
centos6.5:
# rpm -Uvh # rpm -Uvh
centos7:
1安裝EPEL源:EPEL源是centos下一個非常強大的擴充yum源(反正別人都這麼說)
2安裝REMI源:這個是用來安裝和更新PHP的,由於有的東西(比如laravel架構)php的版本是有要求的,而centos預設安裝的php版本是比較低的,因此我們通過這個yum源可以安裝較新的php。
# yum install epel-release# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
使用yum list命令查看可安裝的包(Packege):
# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
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-xhprof
查看php版本:
# php --version
重啟apache:
#systemctl restart httpd.server
寫段php指令碼測試
650) this.width=650;" src="https://s3.51cto.com/wyfs02/M02/8E/99/wKiom1jGXZnD4IJGAAFYZU9q5bw523.png" title="111.png" alt="wKiom1jGXZnD4IJGAAFYZU9q5bw523.png" />
本文出自 “心有多大” 部落格,轉載請與作者聯絡!
CentOS安裝PHP5.6