# Upgrading PHP to 7.3

**URL:** <https://help.nextcloud.com/t/upgrading-php-to-7-3/51035>\
**Category:** ℹ️ Support\
**Tags:** ubuntu, php73\
**Created:** [April 5, 2019, 8:25pm UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035 "2019-04-05T20:25:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baron164](https://help.nextcloud.com/user_avatar/help.nextcloud.com/baron164/32/5639_2.png) [@Baron164](https://help.nextcloud.com/u/Baron164)\
**Post date:** [April 5, 2019, 8:25pm UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/1 "2019-04-05T20:25:11Z")

</div>

Currently running Nextcloud 15.0.5 on Ubuntu 16.0.4 with php 7.0.33. I installed php 7.3, however Nextcloud is still seeing the old version of php.

“\* You are currently running PHP 7.0.33-0ubuntu0.16.04.3. Upgrade your PHP version to take advantage of [performance and security updates provided by the PHP Group](https://secure.php.net/supported-versions.php) as soon as your distribution supports it.”

If I run php -v I see this:

PHP 7.3.3-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:31:26) ( NTS )  
Copyright © 1997-2018 The PHP Group  
Zend Engine v3.3.3, Copyright © 1998-2018 Zend Technologies  
with Zend OPcache v7.3.3-1+ubuntu16.04.1+deb.sury.org+1, Copyright © 1999-2018, by Zend Technologies

What do I need to do in order for Nextcloud to start using the new version of php?

---

<div class="post-metadata">

**Author:** ![vvong](https://help.nextcloud.com/letter_avatar/vvong/32/5_5575768a8748004e209b776fc1b2916d.png) [@vvong](https://help.nextcloud.com/u/vvong)\
**Post date:** [April 6, 2019, 1:33am UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/2 "2019-04-06T01:33:55Z")

</div>

Nextcloud uses whatever you “assigned” your web server runs on.

Running php7.3 on Ubuntu 16.0.4 is not official. Check the source/tutorial how you do it for the solution you want. No one knows what you had done, and no one interests on that too.

BTW, I did have experience with some handicap tutorial that manage to make it looks like php7.3 is installed, yes, looks like only. Check those comments (from other people, if any) of that tutorial you followed too. Used to be quite helpful. Good luck.

---

<div class="post-metadata">

**Author:** ![Baron164](https://help.nextcloud.com/user_avatar/help.nextcloud.com/baron164/32/5639_2.png) [@Baron164](https://help.nextcloud.com/u/Baron164)\
**Post date:** [April 6, 2019, 1:47am UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/3 "2019-04-06T01:47:08Z")

</div>

Yeah, I did some research before hand and followed this to install the newer version of php.

> **[How To Install PHP (7.3, 7.2 & 7.0) on Ubuntu 18.04 & 16.04 via PPA](https://tecadmin.net/install-php-7-on-ubuntu/)**
>
> Install PHP 7 on Ubuntu. This tutorial will help you to install PHP 7.3, 7.2, 7.1 & 7.0 on Ubuntu 18.04, 17.10, 16.04 LTS & 14.04 LTS systems using PPA.

It’s getting Apache to use 7.3 that I’m having the issue with.

First I did this:

sudo a2dismod php7.0  
sudo a2enmod php7.3  
sudo service apache2 restart

I then confirmed the selection by running:

sudo update-alternatives --config php

But when apache runs I only get an HTTP Error 500 “This page isn’t working” message.

When I reverse it and go back to 7.0 the site works again.

---

<div class="post-metadata">

**Author:** ![vvong](https://help.nextcloud.com/letter_avatar/vvong/32/5_5575768a8748004e209b776fc1b2916d.png) [@vvong](https://help.nextcloud.com/u/vvong)\
**Post date:** [April 6, 2019, 2:22am UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/4 "2019-04-06T02:22:08Z")

</div>

> [@Baron164](#):
>
> sudo update-alternatives --config php

I had used this command before too. I only remember that I also did a lot of tweaks here and there. It worked but I worried how long can this status last. Because I want a stable NC, finally I go Ubuntu 18.04 which officially comes with php7.2

---

<div class="post-metadata">

**Author:** ![inX](https://help.nextcloud.com/letter_avatar/inx/32/5_5575768a8748004e209b776fc1b2916d.png) [@inX](https://help.nextcloud.com/u/inX)\
**Post date:** [April 7, 2019, 7:21am UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/5 "2019-04-07T07:21:09Z")

</div>

Did you update the php modules as well? They need to be updated too.

---

<div class="post-metadata">

**Author:** ![Baron164](https://help.nextcloud.com/user_avatar/help.nextcloud.com/baron164/32/5639_2.png) [@Baron164](https://help.nextcloud.com/u/Baron164)\
**Post date:** [April 8, 2019, 1:31pm UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/6 "2019-04-08T13:31:25Z")

</div>

Thank you, apparently I had installed the 7.2 Modules instead of the 7.3 modules. So I went back and installed the 7.3 modules and then enabled php 7.3 again. Had to work through a few issues such as enabling opcache but I’m currently getting a green All Checks Passed notice so hopefully I’m good now.

---

<div class="post-metadata">

**Author:** ![castillo92](https://help.nextcloud.com/user_avatar/help.nextcloud.com/castillo92/32/26776_2.png) [@castillo92](https://help.nextcloud.com/u/castillo92)\
**Post date:** [April 9, 2019, 6:57am UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/7 "2019-04-09T06:57:24Z")

</div>

I did this and it is working on a Raspberry Pi 3+

# INSTALLING PHP7-MARIADB-APACHE2 ( **L** inux **A** pache **M** ySQL **P** HP)

```
sudo apt-get update

sudo apt-get install apache2 mariadb-server

```

At the installation of the MySQL/MariaDB server, you will be prompted to create a root password. Be sure to remember your password as you will need it during Nextcloud database setup.

> sudo apt install ca-certificates apt-transport-https
> 
> wget -q [https://packages.sury.org/php/apt.gpg](https://packages.sury.org/php/apt.gpg) -O- | sudo apt-key add -
> 
> echo "deb [https://packages.sury.org/php/](https://packages.sury.org/php/) stretch main" | sudo tee /etc/apt/sources.list.d/php.list

> sudo apt-get install php7.3 php7.3-cli php7.3-common php7.3-mysql php7.3-fpm php7.3-curl php7.3-opcache libapache2-mod-php7.3 php7.3-mbstring php7.3-xml php7.3-gd php7.3-imagick php7.3-recode php7.3-tidy php7.3-xmlrpc php7.3-bz2 php7.3-intl php7.3-json php7.0-mbstring php7.3-imap php7.3-pspell php7.3-xsl php7.3-zip php-memcache php-redis php7.0-mcrypt php-pear php-zip

> sudo a2dismod php7.0
> 
> sudo a2enmod php7.3
> 
> sudo service apache2 restart
> 
> php -version
> 
> sudo update-alternatives --config php
> 
> mysql --version
> 
> sudo systemctl start apache2
> 
> sudo systemctl enable apache2

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 9:41am UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/8 "2024-12-04T09:41:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 2:45pm UTC](https://help.nextcloud.com/t/upgrading-php-to-7-3/51035/9 "2024-12-11T14:45:31Z")

</div>


