IntroductionPHP 8.0 is a significant update of the PHP language that contains many new features and optimizations. However, Ubuntu 20.04 LTS only includes PHP 7.4 in its official repositories. This guide explains how to upgrade PHP to version 8.0 and configure Nginx to use it. Show Prerequisites
While you can directly apply this guide on your production server, it is best to test it first by restoring a snapshot of your production server to a test instance. Read the Snapshots Quickstart Guide for more details on creating snapshots and deploying new servers from them. 1. List Installed PHP 7.4 Packages
2. Install PHP 8.0 PackagesYou can install PHP 8.0 from the ppa:ondrej/php repository developed by Ondřej Surý, a long-time Debian developer.
3. Configure NginxNginx and PHP-FPM 7.4 communicate with each other via a socket created by PHP-FPM 7.4. Therefore, to switch to PHP-FPM 8.0, you need to configure a new socket for PHP-FPM 8.0 and reconfigure Nginx with that socket.
Before applying the new configuration, you need to follow the next section to configure PHP 8.0. 4. Configure PHP 8.0
5. Verify the SetupOpen your website in your browser. Test and make sure all features are working as expected. If you decide to remove PHP 7.4, do the following:
More InformationSee more information about the new features of PHP 8. Can I downgrade my PHP version?If you'd like to downgrade your PHP installation you can do so without interfering with the path to your installation and can simply overwrite older files. This process will overwrite your current PHP.
How do I change my PHP version?Changing the PHP version. Navigate to the Manage Websites page.. Click the Manage button to the right of your domain.. Under the PHP section, click the Modify icon.. Choose a version of PHP from the dropdown menu.. Scroll down and click the Change PHP Version button to save your changes.. How do I uninstall PHP 8?First Of all, You just need to run the purge command. Just run this command in your terminal: sudo apt-get purge php8. * The above command will Uninstall Any of the PHP 8. X versions of PHP installed on your Server.
How can I download old version of PHP?If you need a rollback of PHP, check out the app's version history on Uptodown. It includes all the file versions available to download off Uptodown for that app. Download rollbacks of PHP for Windows.
|