How to Install Php5.6 in amazon linux

后端 未结 5 1230
无人共我
无人共我 2020-12-13 19:21

I\'m trying to install php 5.6 on Amazon linux using the following command:

$ yum install php56
No package php56 ava         


        
相关标签:
5条回答
  • 2020-12-13 20:03

    Below are the steps I have used to update PHP version from 5.3 to 5.6 in Amazon Linux

    Steps (Use sudo only if required)

    1) Remove OLD Apache

    sudo service httpd stop
    sudo yum erase httpd httpd-tools apr apr-util
    

    2) Remove OLD PHP

    sudo yum remove php-*
    

    3) Install PHP 5.6 (Apache 2.4 will be automatically installed with this)

    sudo yum install php56
    

    4) Make sure all the required PHP extensions are installed

    yum list installed | grep php
    

    5) If not then install them using

    sudo yum install php56-xml php56-xmlrpc php56-soap php56-gd
    

    6) To list the other available php extensions

    yum search php56
    

    7) PHP 5.6 MySQL extension (Assume you have already installed MySQL)

    sudo yum install php56-mysqlnd 
    

    (NOTE: it is not php56-mysql)

    8) Start / Restart Apache

    sudo service httpd start
    sudo service httpd restart
    

    9) Check the version

    php -v
    httpd -v
    
    0 讨论(0)
  • 2020-12-13 20:03

    Additional part from @Daniele post for resloving this problem.

    This is more help than question, but to help other with problem which I had in my case. I need to install Wordpress site on EC2, but when I tried to run it with public IP address, it was problem. I tried to install php 5.6, but it was not possible.

    I find solution to install php 7.2, using command:

    **amazon-linux-extras install php7.2**
    

    TO check that is really version php 7.2, use:

    php -version  or   php -v
    

    After this, you need to stop apache service, command for stop is:

    service httpd stop
    

    Start again apache service:

    service httpd start
    

    In your AWS console, go to Instance, find public IP address, copy and open in browser. You should see the WordPress page. You can install WordPress in Advanced part (bootstraping), when you create EC2 instance.

    0 讨论(0)
  • 2020-12-13 20:10

    AWS has not yet packaged php 5.6. You need to install php 5.5 from the ALAMI repositories, or build 5.6 from source.

    To list the available 5.5 packages use yum search php55

    The php55 is the base package, but you may need others listed as well.

    When 5.6 is ready, you'll be able to find it with yum search php56

    You can find information on building the source at php.net, specifically Installation on Unix Systems / Apache 2.x on Unix Systems

    0 讨论(0)
  • 2020-12-13 20:13

    Try this:

    sudo yum -y update
    
    sudo yum install –y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    
    sudo wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    sudo wget https://centos7.iuscommunity.org/ius-release.rpm
    
    sudo rpm -Uvh ius-release*.rpm
    
    sudo yum -y update
    

    When you install the package you'll need to add a u to the end of php56. Here is an example of some packages you could install.

    sudo yum -y install php56u php56u-opcache php56u-xml \
      php56u-mcrypt php56u-gd php56u-devel php56u-mysql \
      php56u-intl php56u-mbstring php56u-bcmath php56u-soap
    
    0 讨论(0)
  • 2020-12-13 20:15

    Just to mantain update the answers, I tryed the proposed solution and didn't work.

    Quite hard to install 5.6

    I found the right command nowaday to install 7.2 is

    amazon-linux-extras install php7.2
    

    it install and upgrade everything without complications.

    0 讨论(0)
提交回复
热议问题