400-1513-886

全国统一服务热线

系统运维

centos7安装php5.6版本

发布时间:2018-07-24 20:31:18 967 次

# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# yum list php*
可以发现里面有很多版本的php
选择对应的安装的包
# yum  -y  install php56w php56w-mysql php56w-gd libjpeg* php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mbstring php56w-bcmath

拓展
#yum -y install epel-release
#yum groupinstall "development tools"
#yum -y install mhash mhash-devel mcrypt

个性配置

配置php.ini
#vi /etc/php.ini
找到 /date.timezone

date.timezone = PRC

然后重启
#systemctl restart mysql.service

#systemctl restart httpd.service

===================================================================

配置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.rpm

以下是CentOS 7.0的源。

# 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

安装PHP5.6

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

扫码进入小程序

公司名称:广州统天网络科技有限公司

公司地址:广州市白云区石井镇潭村水闸街6号

公司电话:400-1513-886

公司邮箱:info@tongtian.tech