# Ugrade to PHP7.4

**URL:** <https://help.nextcloud.com/t/ugrade-to-php7-4/61896>\
**Category:** ℹ️ Support\
**Tags:** nc16, php\
**Created:** [October 12, 2019, 6:41pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896 "2019-10-12T18:41:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![herrb82](https://help.nextcloud.com/user_avatar/help.nextcloud.com/herrb82/32/18240_2.png) [@herrb82](https://help.nextcloud.com/u/herrb82)\
**Post date:** [October 12, 2019, 6:41pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/1 "2019-10-12T18:41:49Z")

</div>

Nextcloud version : 16.0.5.1  
Operating system and version : Ubuntu 18.04 LTS  
Apache or nginx version : 2.4.29  
PHP version : 7.4.0

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

Steps to replicate it:

The following errors replacing themselves since I’ve upgraded php7.2 to php7.4.  
Nextcloud instance is working, but I don’t understand these logs.

The output of your Nextcloud log in **Admin \> Logging** :

```auto
[PHP] Error: Function ReflectionType::__toString() is deprecated at /var/www/html/nextcloud/lib/private/AppFramework/Utility/ControllerMethodReflector.php#80

[PHP] Error: Array and string offset access syntax with curly braces is deprecated at /var/www/html/nextcloud/apps/news/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php#162

[PHP] Error: Array and string offset access syntax with curly braces is deprecated at /var/www/html/nextcloud/apps/theming/lib/Util.php#114

```

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

```auto
<?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => 'my.domain',
  ),
  'datadirectory' => 'my datadirectory',
  'dbtype' => 'mysql',
  'version' => '16.0.5.1',
  'overwrite.cli.url' => 'my.domain',
  'htaccess.RewriteBase' => '/',
  'overwriteprotocol' => 'https',
  'dbname' => '***',
  'dbhost' => '***',
  'dbport' => '',
  'dbtableprefix' => '***',
  'dbuser' => '***',
  'dbpassword' => '***',
  'installed' => true,
  'default_language' => 'de',
  'default_local' => 'de_DE',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '***',
  'mail_domain' => '***',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '***',
  'mail_smtpport' => '***',
  'mail_smtpname' => '***',
  'mail_smtppassword' => '***',
  'mysql.utf8mb4' => true,
  'logtimezone' => 'Europe/Berlin',
  'theme' => '',
  'loglevel' => 2,
  'app_install_overwrite' =>
  array (
    0 => 'calendar',
    1 => 'tasks',
  ),
);

```

The output of your Apache/nginx/system log in `/var/log/ ____ `:

```auto
[Sat Oct 12 06:25:03.612103 2019] [:notice] [pid 12102:tid 140690619755456] FastCGI: process manager initialized (pid 12102)
[Sat Oct 12 06:25:03.614661 2019] [mpm_event:notice] [pid 27248:tid 140690619755456] AH00489: Apache/2.4.29 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 OpenSSL/1.1.1d configured -- resuming n$
[Sat Oct 12 06:25:03.614684 2019] [core:notice] [pid 27248:tid 140690619755456] AH00094: Command line: '/usr/sbin/apache2'
[Sat Oct 12 09:05:09.375551 2019] [proxy_fcgi:error] [pid 12103:tid 140690084316928] (70007)The timeout specified has expired: [client 91.22.213.15:60025] AH01075: Error dispatching request to : ($
[Sat Oct 12 14:43:18.330351 2019] [mpm_event:notice] [pid 27248:tid 140690619755456] AH00493: SIGUSR1 received. Doing graceful restart
[Sat Oct 12 14:43:18.518842 2019] [:notice] [pid 16871:tid 140690619755456] FastCGI: process manager initialized (pid 16871)
[Sat Oct 12 14:43:18.530246 2019] [mpm_event:notice] [pid 27248:tid 140690619755456] AH00489: Apache/2.4.29 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 OpenSSL/1.1.1d configured -- resuming n$
[Sat Oct 12 14:43:18.530276 2019] [core:notice] [pid 27248:tid 140690619755456] AH00094: Command line: '/usr/sbin/apache2'
[Sat Oct 12 14:43:34.454757 2019] [mpm_event:notice] [pid 27248:tid 140690619755456] AH00493: SIGUSR1 received. Doing graceful restart
[Sat Oct 12 14:43:34.516577 2019] [:notice] [pid 17015:tid 140690619755456] FastCGI: process manager initialized (pid 17015)
[Sat Oct 12 14:43:34.519591 2019] [mpm_event:notice] [pid 27248:tid 140690619755456] AH00489: Apache/2.4.29 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 OpenSSL/1.1.1d configured -- resuming n$
[Sat Oct 12 14:43:34.519615 2019] [core:notice] [pid 27248:tid 140690619755456] AH00094: Command line: '/usr/sbin/apache2'

```

---

<div class="post-metadata">

**Author:** ![Schmu](https://help.nextcloud.com/user_avatar/help.nextcloud.com/schmu/32/7823_2.png) [@Schmu](https://help.nextcloud.com/u/Schmu)\
**Post date:** [October 12, 2019, 7:25pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/2 "2019-10-12T19:25:38Z")

</div>

Hi,

I just searched on Github and this issue has indeed be reported and was fixed for NC17.  
User report:

> <https://github.com/nextcloud/server/issues/16574>
>
> Steps to reproduce
> Run Nextcloud on a server with PHP 7.4 beta version
> Lookup warnings in PHP error logs.
> Expected behaviour
> No warnings.
> Actual behaviour
> Warnings about...

Fix for NC17:

> <https://github.com/nextcloud/server/pull/16493>

_Edit: Just updated the issue and asked for a backport 🙂_

A fix would come in the next release first. If you don’t want to update to NC17 yet, you could change the files manually. However this has the drawback of integrity check warnings in the admin overview.

---

<div class="post-metadata">

**Author:** ![herrb82](https://help.nextcloud.com/user_avatar/help.nextcloud.com/herrb82/32/18240_2.png) [@herrb82](https://help.nextcloud.com/u/herrb82)\
**Post date:** [October 12, 2019, 7:29pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/3 "2019-10-12T19:29:52Z")

</div>

Thx for the quick answer

---

<div class="post-metadata">

**Author:** ![Schmu](https://help.nextcloud.com/user_avatar/help.nextcloud.com/schmu/32/7823_2.png) [@Schmu](https://help.nextcloud.com/u/Schmu)\
**Post date:** [October 12, 2019, 7:34pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/4 "2019-10-12T19:34:51Z")

</div>

Sure 🙂

If you need help with manually fixing the errors, feel free to post the mentioned lines (in the error messages) of each file and I can show you the necessary changes to these files, if you need assistance.

---

<div class="post-metadata">

**Author:** ![herrb82](https://help.nextcloud.com/user_avatar/help.nextcloud.com/herrb82/32/18240_2.png) [@herrb82](https://help.nextcloud.com/u/herrb82)\
**Post date:** [October 12, 2019, 7:37pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/5 "2019-10-12T19:37:05Z")

</div>

Nextcloud is working fine so long 🙂  
I’ll just wait since Nextcloud 17 released on stable channel.

---

<div class="post-metadata">

**Author:** ![kesselb](https://help.nextcloud.com/user_avatar/help.nextcloud.com/kesselb/32/74519_2.png) [@kesselb](https://help.nextcloud.com/u/kesselb)\
**Post date:** [October 12, 2019, 8:36pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/6 "2019-10-12T20:36:06Z")

</div>

> [@herrb82](#):
>
> Function ReflectionType::\_\_toString() is deprecated at /var/www/html/nextcloud/lib/private/AppFramework/Utility/ControllerMethodReflector.php#80

Thanks 👍 This one is unfixed 🐛

---

<div class="post-metadata">

**Author:** ![anon9582441](https://help.nextcloud.com/letter_avatar/anon9582441/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9582441](https://help.nextcloud.com/u/anon9582441)\
**Post date:** [November 30, 2019, 1:35pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/7 "2019-11-30T13:35:52Z")

</div>

Seems that they added a block on PHP 7.4. When I enable 7.4 and run occ I get a warning that Nextcloud won’t run with 7.4.

I am using NC 17.0.1

---

<div class="post-metadata">

**Author:** ![kesselb](https://help.nextcloud.com/user_avatar/help.nextcloud.com/kesselb/32/74519_2.png) [@kesselb](https://help.nextcloud.com/u/kesselb)\
**Post date:** [November 30, 2019, 2:04pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/8 "2019-11-30T14:04:28Z")

</div>

> <https://github.com/nextcloud/server/blob/c4561be5500c70216051b48985bf96894f702791/lib/versioncheck.php#L12-L17>

> <https://github.com/nextcloud/server/pull/18064>

I would not use 17 with PHP 7.4.

---

<div class="post-metadata">

**Author:** ![herrb82](https://help.nextcloud.com/user_avatar/help.nextcloud.com/herrb82/32/18240_2.png) [@herrb82](https://help.nextcloud.com/u/herrb82)\
**Post date:** [November 30, 2019, 2:18pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/9 "2019-11-30T14:18:32Z")

</div>

Since the last upgrade of 7.4 nextcloud doesn’t work. Just the message “this Version…”.  
Roll Back to 7.2 solved the problem

---

<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, 10:36am UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/10 "2024-12-04T10:36:56Z")

</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, 3:46pm UTC](https://help.nextcloud.com/t/ugrade-to-php7-4/61896/11 "2024-12-11T15:46:15Z")

</div>


