####To install a modern version of PHP on Red Hat and CentOS
I recommend using the Webtatic ( https://webtatic.com/ ) yum repository.
First, add the repository with the Webtatic release RPM; you should use the repository that matches your specific version
# CentOS/REHL 7
Adding the Webtatic Repository
$ yum -y update
$ sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Installing PHP Packages from Webtatic
$ yum install
php71w.x86_64
php71w-mysql.x86_64
php71w-mbstring.x86_64
php71w-xml.x86_64
php71w-pecl-xdebug.x86_64
install the MySQL client and server
Installing MySQL on REHL
$ sudo yum install mysql-server mysql
(这里我用的是:
sudo yum install mariadb-server mariadb
执行完后, sudo systemctl status mariadb.service
)
(备注: 这里犯了个低级错误, 在自己的ubuntu系统里执行sudo yum install mysql-server mysql, 报错如下:
没有已启用的仓库。
执行 "yum repolist all" 查看您拥有的仓库。
您可以用 yum-config-manager --enable <仓库名> 来启用仓库
那么自己就设置仓库(To set up the repository---https://webtatic.com/projects/yum-repository/):
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm,结果报错:
rpm:RPM should not be used directly install RPM packages, use Alien instead! 可笑!!我在ubuntu系统 用rpm安装rpm包, 所以
提示让我转换 rpm为ubuntu能够识别的包。!!
)
Securing the MySQL Installation
Once MySQL is installed, you should set a root password
$sudo /usr/bin/mysql_secure_installation
(备注:sudo: /usr/bin/mysql_secure_installation:找不到命令,原因是: mysql-server没有安装成功
执行完 sudo yum install mariadb-server mariadb,之后就能找到命令了
)
################