skip to Main Content

I have a web server with PHP 7.3 installed (And Apache + WordPress), plus a number of PHP related modules. This server is on AWS Linux.

When the AWS repo makes PHP 7.4 available, what’s the best way to upgrade the PHP 7.3 packages to 7.4 and preserve my PHP configs? I’m assuming that sudo yum upgrade isn’t going to cut it. Will I need to uninstall php73-* and then install php74-*?

By way of showing what I have:

yum list installed *php*
Loaded plugins: priorities, update-motd, upgrade-helper
Installed Packages
php73.x86_64                       7.3.17-1.25.amzn1               @amzn-updates
php73-cli.x86_64                   7.3.17-1.25.amzn1               @amzn-updates
php73-common.x86_64                7.3.17-1.25.amzn1               @amzn-updates
php73-gd.x86_64                    7.3.17-1.25.amzn1               @amzn-updates
php73-json.x86_64                  7.3.17-1.25.amzn1               @amzn-updates
php73-mbstring.x86_64              7.3.17-1.25.amzn1               @amzn-updates
php73-mysqlnd.x86_64               7.3.17-1.25.amzn1               @amzn-updates
php73-pdo.x86_64                   7.3.17-1.25.amzn1               @amzn-updates
php73-process.x86_64               7.3.17-1.25.amzn1               @amzn-updates
php73-xml.x86_64                   7.3.17-1.25.amzn1               @amzn-updates

2

Answers


  1. To install PHP 7.4 along with all related packages (extensions) you can use Remi’s repository, it even has a setup wizard that will walk you through the process here https://rpms.remirepo.net/wizard/

    But you’ll have to uninstall your current php version, what I do in these situations is just run php -m, save all the modules I have and know my web app will use and then do a yum remove php* to remove all traces but review carefully all the removed packages before accepting as it may remove other packages because of dependencies.

    Login or Signup to reply.
  2. In amazon linux,

    yum install php73
    

    yum can install PHP 7.3, but not activate it. While it is available in the system, it is not in the path. To activate it, configure it as the preferred alternative.
    use following command:

    sudo alternatives --config php
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search