I use the Turnkey Nextcloud LCX appliance.

Just upgraded Nextcloud to v23, and got the message that for Nextcloud v24 PHP7.3 isn't supported anymore. 
In the Trunkey repositories, PHP7.3.31 is the latest version. Can I just upgrade it from the PHP website (build it myself), or use the debian repository, or do I need to do something special to upgrade?

 

Forum: 

Missed the comment from Jeremy in another post about php. Probably had a brainfart when using the search function.

Here's the comment, and how to update PHP if you really need to:

https://www.turnkeylinux.org/comment/50598#comment-50598

Don't just follow the guide, and update your Nextcloud-turnkey LCX without making snapshots beforehand :)
Just bricked it a bit when applying the php update. Made a snapshot beforehand, so no harm done. Nice to be able to test it out, probably missed a php package I should've installed. I'll mess with it again when NC24 arrives :)

Jeremy Davis's picture

Glad you found the info! Although the fact that you had issues isn't ideal. Perhaps you could consider creating a new test server from a snapshot? That way you can leave your current server as is until you have confirmed you have a working process. Please feel free to post specifics of the issues you hit and I'm more than happy to do my best to help out.

Probably just forgot to add some php packages. Saw I got a PHPxxx not found error in Nextcloud, and as it was just a quick and dirty test, I didn't bother to look into it, and just reverted the snapshot.

If I have a bit of time in the coming weeks, I'll clone the container, and see what actually happens and report back.

Jeremy Davis's picture

Ok, now worries! :)
Jeremy Davis's picture

Sounds like a plan...! :)

I agree completely. Why fix something that isn't actually broken?!

Jeremy Davis's picture

The fact that the phpinfo page worked (and I assume reported php7.4 running and didn't show any errors or warnings?!) suggests that PHP itself was working as expected. Nextcloud supports PHP7.4 - in fact, their current docs note that as the minimum version. So that seems an unlikely cause of the issue. So the only thing that occurs to me is that perhaps there is a (php package) Nextcloud dependency missing?

I wasn't explicit about which PHP packages you should install because it will vary from use case to use case. I only documented how to collect the PHP packages (technically, any package that included PHP in it's name) installed and hints around how to work out what you should need to install for the newer PHP version. Perhaps that wasn't explicit enough?

A quick look at the logs might clear that up. If my guess is right (and it's a missing module), it might even be obvious what package needs to be installed? A good place to start is checking the last 20 lines of the Apache error log:

tail -20 /var/log/apache2/error.log

As you probably guessed, you can change the number to show more or less lines. It can sometimes be nice to watch the log live instead:

tail -f /var/log/apache2/error.log

Then you can refresh the page in your browser and you should see the errors appearing in the log in real time.

(Ctrl-C to exit)

Bob J's picture

Its been a few months but last I checked someone said the New Turkey 17.1 ISO for nextcloud was like 2 weeks away from being finished.    Is it out?   
Sean S's picture

Hi, I went through a process similar to the above and ran into the same error. First of all, by examining the packages that contain "php" in the name, I installed the following ones:   apt install libapache2-mod-php8.0 php8.0-cli php8.0-common php8.0-curl php8.0-gd php8.0-gmp php8.0-imap php8.0-intl  php8.0-ldap php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-xml php8.0-zip   Following the error log, I found this error: [Thu Aug 18 21:18:55.427595 2022] [php:error] [pid 472] [client 192.168.100.103:52537] PHP Fatal error:  Uncaught OCP\\HintException: [0]: Memcache \\OC\\Memcache\\Redis not available for local cache (Is the matching PHP module installed and enabled?)\n\n  thrown in /var/www/nextcloud/lib/private/Memcache/Factory.php on line 94 After some searching, I decided to install the following extra packages: apt install memcached php8.0-memcached redis-server php8.0-redis php8.0-apcu I then put apc.enable_cli=1 in /etc/php/{{ php_version }}/mods-available/apcu.ini. (Before intall php8.0-apcu, there's no apcu.ini inside mods-available in my case.) Now I can update to NC 24.0.4. Admittedly, the extra packages I installed above may not all be required. I just didn't get a chance to do a thorough bisection. I hope this note could be helpful to those in the same boat trying to upgrade php so that turnkey NC can be further upgraded. Cheers.   
Jeremy Davis's picture

Thanks for posting back with your fix!

It sounds like there were some PHP modules/libraries missing from your install. I've actually just posted some updated instructions on installing a newer PHP version. It's probably too late for you now, but the first part of that ("Set PHP version to install and collect current PHP version & packages") should ensure that all the same PHP modules/libraries that are installed for the default PHP version, should be installed for the new PHP version.

frees's picture

Thanks, your post was very helpful!
StickyProjectile's picture

My Idiots Guide: for people who have no idea what their doing but still need to Linux it out...

Upgrading TurnKey Linux PHP to PHP 8.0

On your PC
=======================

  1. On your PC Download PHP from https://www.php.net/downloads.php select any of the Stable tar.gz
  2. Log in to WebMin = https://[IP address of turnkey linux]:12321
  3. go to Tools > File Manager
  4. open up [usr/share/] folder
  5. on top menu click [File > Upload to current Directory]
  6. Drag and drop PHP 8.0 tar.gz file and select upload
  7. hover on to uploaded file and click on triple colon and select EXTRACT


On the TurnKey Linux machine CLI:

[NOTE: the following will not work for some reason on Webmin for me]
=======================
on the WordPress Appliance Services Window: Click Enter to Quit
Login as root

Run the following commands one line at a time:

apt update

apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list

wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -

apt update

apt install php8.0

Restart the Machine by typing:

reboot

after reboot run to confirm php version:

php -v

 

and if it liked what you've been in putting it should look something like this:

PHP 8.1.13 (cli) (built: Nov 26 2022 14:29:42) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
    with Znd OPcache v8.1.13, Copyright (c), by Zend Technologies

Note the PHP 8.1.13

 

 

REF:

https://computingforgeeks.com/how-to-install-php-on-debian-linux/

Add new comment