phpwordpressnginxdevopsamazon-linux-2

update php and php-fpm in nginx server


I have a requirement where I need to update the PHP and PHP-fpm to the latest version of the server. this server is hosted using Nginx and WordPress. We are using amazon Linux 2 when I disable php7.4 and enable php8 in amazon-Linux-extras and install I'm getting an error. php error

I have a couple of questions: what happens when I uninstall and install PHP to the latest version does it after the site? Do we have any workaround for this PHP error?

Thanks in advance.

I'm expecting a solution to update my PHP to the latest version without any issues. I have just started learning DevOps. I'm not familiar with these errors


Solution

  • I removed php-json by sudo yum remove php-json and installed of php

    sudo yum install php php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip}

    Still the application works.

    php-json is available in Amazon Linux Extra topic "php7.4"

    $ sudo amazon-linux-extras install php7.4