Nextcloud 20 Upgrading PHP 7.2 to 7.3

Nextcloud version (eg, 20.0.5): 20.0.12
Operating system and version (eg, Ubuntu 20.04): 18.04
Apache or nginx version (eg, Apache 2.4.25): 2
PHP version (eg, 7.4): 7.2

The issue you are facing:
Hey guys, bear with me as I am completely new to this forum but I wanted the experts advice. I recently realized that I was using an outdated version of nextcloud (version 18 I believe). I have been trying to upgrade to the most recent version but I had some problems when trying to upgrade from Nextcloud 20 to 21. My most important issue is upgrading from php 7.2 to 7.3. Would someone mind running me through the correct way to do this? I ssh into my server which is a VPS through linode. I am using root and I have downloaded php 7.3 but I run into numerous problems when trying to upgrade through apache. As I said, I am quite new to the forums so please let me know what other information would be useful to help me fix this issue.

Is this the first time you’ve seen this error? (Y/N): N

The fact that its on a VPS is irrelevant.

You say your operating system and version is “18.04”… Ubuntu?

So what you want to do is go to your favorite search engine, I’d recommend duckduckgo, and search for how to upgrade php to version, say 8, on ubuntu. No sense stopping at 7.3 – if you’re doing a major update, you might as well go as far as it will let you.

Please don’t get stuck trying to do things the “windows” way on Linux, which would be to download the update from the vendor’s website and try to install it. You need to work through your distro’s package manager.

Here’s an example (I don’t vouch for the quality of this example, I don’t use ubuntu and cant gauge it):

From what I gather, ubuntu 18.04 does not package any php version above 7.2, which means that you need to add a 3rd party repository (something something “ppa”?). You then use the package manager to install from that repository and off to the races you go.

Thanks for reaching out. And yes to clarify I am running the server on Ubuntu 18.04. However, I have already tried to upgrade php from 7.2 to 7.3 and also to 7.4 and even to 8. The issue is I do not know how to tell apache that I am using that version of php. Also I am on nextcloud 20 and I can’t upgrade to 21 without at least getting the php on the server to 7.3. And nextcloud 20, I believe, will not support php beyond 7.4 anyways. Let me know what you think. I am comfortable in the command line and I run my native desktop environment in Ubuntu as well. Just looking for the proper steps.

And like I said, you’re going to have to go to a search engine and find “proper steps” that you are comfortable with and confident in.

I didn’t realize the answers to my forum questions would be to “google” it. Don’t you think I have tried using a search engine to fix this issue?

Your question has nothing to do with the topic of this forum.

:information_source: Support

Support on configuring and using Nextcloud after it is up and running. For installation questions, use the install category.

I am confused. Where should I be asking this question to actually receive some help?

I don’t know why you would be asking a distro related question here. This forum is about nextcloud, not your distro. For help with your distro, you need to seek help from those who provide support FOR YOUR DISTRO.

@EyeOfAgamotto welcome to the user-forums of NC.

@Larry_Boyd is right: you better should have searched the forum for a string like “upgerade php” or similar. And again yes: it’s not about NC, primarily. But as you can see, we do our best to feature that as well (whenever we see such things).

as you didn’t provide enough info I really can’t help you further than just posting 2 random solutions from the dozens I found.

(there are way more!)

so it’s up to you trying them. remember to have fresh backups ready, just in case.

awww and don’t forget to post the working solution here as an answer.


1 Like

@JimmyKater thank you for the response.

I realize I didn’t provide much info but I would have been happy to include additional details if I knew exactly what was needed to aid me in the process. I had root shell access to the server and I could have provided logs or further explained the details. The issue was not really related to my distribution. I wanted to upgrade from Nextcloud 21 to 22 and I couldn’t do that due to a different php version being required (not to mention that MariaDB also needed to be updated). My issue was that the entire nextcloud instance would get 404 errors or just go down if I changed the php version using a command such as “sudo a2enmod php7.4.” I tried purging the php and disabling all other versions but eventually gave up. I decided to create an entirely new nextcloud instance. I completely rebuilt the linode vps and decided to go with Ubuntu 20.04 LTS. I then did a fresh install of Nextcloud 22 which uses php 7.4 by default. I am the only user of this instance so it wasn’t a problem to do a fresh install.

I appreciate the advice and reply though. I didn’t so much fix the issue as completely restart from scratch but I think the process was worth it. Again, thanks for reaching out.


1 Like