I am having trouble re-installing PHP via yum on my server hosted by digital ocean.
I had PHP 5.4 installed but wanted 5.6. I added/enabled the remi repo\'s, ran
I fixed it! The issue was that I had the wrong version of EL installed. I removed all my extra repo's, removed all php packages, removed httpd. Ran the following:
yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum clean
yum update
I was then able to install PHP using the following
yum install php56w php56w-opcache php56w-mcrypt php56w-pdo php56w-mysql
Though this probably suits serverfault or poweruser better, I will still answer.
This is based from experience and works every single time if done as instructed.
To install, first you must add the Webtatic EL yum repository information corresponding to your CentOS/RHEL version to yum:
CentOS/RHEL 7.x:
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Then you can install each of your individual packages like this:
yum install php56w-<package name>
Don't forget the php56w prefix though.
Source: https://webtatic.com/packages/php56/
Try this (in regards to the comments):
yum update -y; yum remove httpd && yum install httpd; yum install php56w-common php56w-opcache php56w-mysql
I also encountered the same problem while installing php70w(webstatic) on my linux machine. The following command helped me to install php70
sudo yum clean all // to clear all caches
after clearing cache again install php70 using:
sudo yum install php70