Amazon Linux: upgrade phph 5.6 to 7.3 and 7.0 to 7.3

0

I have several Ec2 instances created with Amazon Linux AMI 2018.03, oneis currently running php 7.0 and the others are still running php 5.6. I have been running around in circles trying upgrade to php 7.3. I've been trying first on the one running 7.0, thinking it would be the least painful, but no joy.

Among other attemps, i have tried:
sudo yum install -y php73-gd php73-xml php73-xmlrpc php73-mcrypt php-pear
which give me the following errors:
Error: php70-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: php73-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: php70-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
Error: php73-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64

And with:
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
which gives me these errors:
Error: php70 conflicts with php-5.3.29-1.8.amzn1.x86_64
Error: httpd24-tools conflicts with httpd-tools-2.2.34-1.16.amzn1.x86_64
Error: php70-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
Error: php70-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.34-1.16.amzn1.x86_64

Has anyone had any luck/experience with this? Is there a guide somewhere?

Juno
asked 5 years ago2727 views
6 Answers
0
Accepted Answer

Hi,
sorry, one correction.. also need to install "php73" :-)
Correct sequence below..

sudo yum update
sudo service httpd stop
sudo yum remove php*
sudo yum remove httpd*
sudo yum clean all
sudo yum upgrade -y
sudo yum install httpd24
sudo yum install -y php73 php73-gd php73-xml php73-xmlrpc
sudo yum install mod24_ssl
[root@ip-172-31-43-79 ~]# php -v
PHP 7.3.6 (cli) (built: Jun 12 2019 20:51:34) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies

After upgrading, the current pear version seems to be compatible with 7.3.6

[root@ip-172-31-43-79 ~]# pear version
PEAR Version: 1.10.9
PHP Version: 7.3.6
Zend Engine Version: 3.3.6
Running on: Linux ip-172-31-43-79 4.14.123-86.109.amzn1.x86_64 #1 SMP Mon Jun 10 19:44:53 UTC 2019 x86_64

Hope this helps!
-randy

Edited by: RandyTakeshita on Aug 27, 2019 9:38 AM

answered 5 years ago
0

Hi,
Not sure if this helps, but I was able to run the following command on Amazon Linux 1 and it upgraded from php 5.6 to php 7.3. Note: php73-mcrypt does NOT exist and php-pear causes those conflicts..

sudo yum update
sudo service httpd stop
sudo yum remove php*
sudo yum remove httpd*
sudo yum clean all
sudo yum upgrade -y
sudo yum install httpd24
sudo yum install -y php73-gd php73-xml php73-xmlrpc
sudo yum install mod24_ssl
[ec2-user@ip-172-31-81-189 pear]$ php --version
PHP 7.0.33 (cli) (built: Jan  9 2019 22:04:26) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

Note: I mainly followed the directions in the following link:
Link: https://fizzbuzzer.com/upgrading-php7-amazon-linux-ec2-instance/
Hope this helps..
-randy

answered 5 years ago
0

Hi Randy - I will give this a shot. Thanks! Question though - if PEAR causes conflicts, what do people usually use for sending html formatted mail via SMTP with PHP 7.3?

Edited by: Juno on Aug 27, 2019 9:00 AM

Juno
answered 5 years ago
0

Thanks, Randy! That worked. I was missing a few modules after, but no sweat to install those. Much appreciated!

Juno
answered 5 years ago
0

I have the same situation. Before I proceed with the above instructions I wanna ask if this does effect the SSLcertificates or other httpd configurations? Probably not but better ask than not to be prepared, right? :)

answered 4 years ago
0

I have the same situation. Before I proceed with the above instructions I wanna ask if this does effect the SSLcertificates or other httpd configurations? Probably not but better ask than not to be prepared, right? :)

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions