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 https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(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

Forum: 
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 sury.org repo to allow users to update (or downgrade) PHP if they wish (most likely disabled by default).

zyrus's picture

Hello,

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.

Rusty Meyners's picture

Jose's command list worked beautifully for me with one or two exceptions. My Webmin didn't support the php.ini edit as explained but didn't seem to matter in the Wordpress operation. One "optional essential" that I added - after almost getting locked out (sorta) - was: apt install php7.3-ldap
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!

 

 

Piotr Jeremicz's picture

Hi everybody,

I have a big problem with updating my PHP on the LAMP server. Following this tutorial I stopped on the command:

apt install php7.3

Unfortunately, I am getting an error:

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php7.3
E: Couldn't find any package by glob 'php7.3'
E: Couldn't find any package by regex 'php7.3'

Next, I am trying to follow the different tutorial and use these commands:

apt-get install software-properties-common
apt-add-repository ppa:ondrej/php

I will be glad for any help. Right now I am totally stopped with the project.

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!

Add new comment