Jose Manuel Andrade Pereira's picture

Good morning, afternoon or evening to the entire turnkey Linux community.

A few days ago I was testing LAMP to install a WordPress blog, and I came up with the idea of upgrading to php 7.3 for WordPress security requirements, I have been reading on several forum sites and other web pages to upload it to php 7.3 and Do not fail in the attempt.

How update Turnkey Lamp 15.1 PHP 7 to PHP 7.3

1. Deploy LAMP VM or Physical Machine, apply updates and any stuffs.

2. Goto ShellBox, enter credentials:

apt-get -y install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg
sh -c 'echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt-get update

Reboot your VM o Wait to Refresh new Repo.

apt update
apt install php7.3
a2dismod php5 php7.0
a2enmod php7.3

service apache2 restart

apt update
apt install samba
apt install webmin-samba
apt install php-mysql

service apache2 restart

3. Goto Webmin, and then go System->PHP Configuration-> click top left gear, and change

/etc/php/7.3/apache2/php.ini=Configuration for mod_php
/etc/php/7.3/cgi/php.ini=Configuration for scripts run via CGI
/etc/php/7.3/cli/php.ini=Configuration for command-line scripts

4. Save Done.

NOTE: If there is something I missed, let me know, I think it works fine for now and it has been updated to PHP 7.3 correctly.

[optional] wordpress php 7.3 essentials:

apt install php7.3-bcmath
apt install php7.3-curl
apt install php7.3-imagick
apt install php7.3-gd

Jeremy Davis's picture

I'm sure others will get value from your post, so thanks for sharing.

FWIW, I'm currently working on our v16.0 release (based on Debian 10/Buster). There is no ETA yet (will be released ASAP - i.e. "when it's ready"). TurnKey v16.0+ appliances that include PHP will provide PHP7.3 by default (from the Debian repos). Although we may well include the repo to allow users to update (or downgrade) PHP if they wish (most likely disabled by default).

zyrus's picture


thx for the greate contribution.
I have a question above your constribution.
Can I do that exactly the same way by Turnkey Linux Wordpress VDI?

Thx fpr your answer :)

Jeremy Davis's picture

Yes, Jose's instructions should work with any v15.x version of TurnKey WordPress. In fact, it should also apply to any v15.x LAMP based TurnKey server! :)

Depending on which plugins you are using, you may need/wish to install some additional PHP libraries. Although if you follow Jose's instructions, that should be enough for most scenarios.

If you have any issues, please post back.

L. Arnold's picture

Finally got the PHP to stick to Joomla this way.

We need to document this a bit more but Very Nice!



Jeremy Davis's picture

First up, assuming you are running a TurnKey server, then it's a really bad idea to install Ubuntu packages on TurnKey! TurnKey is based on Debian. Whilst Ubuntu is also based on Debian, it's not binary compatible (TurnKey is). For me info, please see the "Don't make a FrankenDebian" section of the "Don't break Debian" wiki page.

I really hope that you didn't get too far because cleaning that up might be an issue...!

Next up, these instructions should be working fine. I can only suggest that either you missed a step, copy/pasted something wrong, or there was some other glitch. Perhaps the "apt update" step failed for some reason? Posting the full output of what you did might help? The output of 'apt update" in particular.

If you've already installed packages from an Ubuntu PPA, you'll need to fix that first and get rid of them and remove the PPA from your sources lists. Ideally rolling back to before you installed any of that is probably a good idea if possible. Once you've got back to where you were, then more than happy to try to help you out. If you've installed Ubuntu packages and can't roll back (even if everything seems to be working ok at the moment), then I would suggest trashing this server and starting again. I'm almost certain that continuing on with Ubuntu PPA PHP packages will bite you at some point!

Jeremy Davis's picture

Double check what version of php-mysql is installed like this:

apt policy php-mysql

It should be the same as the version of PHP you are trying to update to. Alternatively you could try explictly installing the version you need, like this:

apt install phpX.Y-mysql

Where X.Y is the version of PHP you are trying to install. E.g. 7.3.

Jeremy Davis's picture

All TurnKey v16.x appliances are built on Debian Buster/10 and PHP is installed direct from the Debian apt repositories. PHP 7.3 is the only version of PHP available from the official Buster repositories.

To double check, try running this:


It should return this (for v16.0 LAMP):


If you only have PHP 7.0, then it's likely a v15.x release (likely v15.1 or later). Assuming v15.1, it should return this:


(v15.x was based on Debian Stretch/9)

But back to your question, I would recommend installing a v16.0 appliance (and be sure that you actually do get v16.x). Then you could use TKLBAM (our custom backup and data migration tool) to migrate your data across if you wish. That should hopefully even take care of installing the additional packages I suspect (although I can't be 100% sure).

Alternatively, you could migrate your data manually. I.e. copy across your files (by default will be in /var/www) and your DB. Then install your additional modules as per your notes; although you can use the shorter apt command instead, plus the packages can all be installed on the one "apt install" line - like this:

apt update
apt install php-gd php-soap php-curl php-mbstring

Add new comment