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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.