How can I downgrade my PHP version?

I have a Linode that is stocked with PHP 7.3.0RC5 (cli) (built: Nov 6 2018 10:22:47) ( NTS )

Some applications like Moodle don't work with release candidates. How can I easily downgrade to PHP 7.2?

Thanks.

1 Reply

It depends on which OS and webserver you're running. In general, you'll want to install the earlier PHP version (which may require finding a repo for it if it's no longer available officially), then disable PHP 7.3 in your webserver and enable the earlier PHP version.

Let's take Ubuntu and Apache as an example. First, install the PHP version you'd like. In this case, 7.2:

apt-get install php7.2

Then, disable PHP 7 in Apache and enable PHP 5.6:

a2dismod php7.3
a2enmod php7.2
service apache2 restart

You can have more than one PHP version installed on your Linode at a time, so there's no need to remove PHP 7.3, and in most cases I'd recommend keeping both just in case software on your Linode requires it.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct