Report this

What is the reason for this report?

I created the droplet using the “Create LAMP droplet” button on https://marketplace.digitalocean.com/apps/lamp#getting-started. My website is old, was created with PHP7.2, and delivers a blank screen with my new droplet. I assume that it will not run on PHP8. What do I need to do to get the droplet using PHP7.2?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

In order to use PHP 7.2, you’ll need to install it and then switch to that PHP version so that Apache knows which one to use.

PHP 7.2 is not included in the default Ubuntu repositories for newer versions of Ubuntu. You need to add the repository maintained by Ondřej Surý, which includes PHP 7.2.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Now you can install PHP 7.2 and the necessary modules.

sudo apt-get install php7.2 php7.2-cli php7.2-fpm php7.2-mysql php7.2-xml php7.2-curl php7.2-gd php7.2-mbstring php7.2-zip php7.2-soap php7.2-intl

You need to disable the current PHP module for Apache and enable the PHP 7.2 module.

sudo a2dismod php8.0
sudo a2enmod php7.2

Finally, restart the Apache server to apply the changes.

sudo systemctl restart apache2

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.