Can't install PHP Package on CentOS

前端 未结 3 980
不思量自难忘°
不思量自难忘° 2021-01-12 06:25

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

相关标签:
3条回答
  • 2021-01-12 06:47

    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
    
    0 讨论(0)
  • 2021-01-12 06:50

    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
    
    0 讨论(0)
  • 2021-01-12 06:51

    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
    
    0 讨论(0)
提交回复
热议问题