Nextcloud Office (built-in CODE) broken after switching Apache from PHP 8.3 to PHP 8.4 (NC32 & NC33)

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.8 and 33.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.66
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • none
  • PHP version (e.g, 8.3):
    • 8.4
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • after upgrade from php8.3 to php8.4
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Old manual install, upgrade OS and NC manual
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I’m sharing a detailed report after troubleshooting an issue with Nextcloud Office (built-in CODE) failing after upgrading PHP from 8.3 to 8.4.

Environment

  • PHP:

    • Working state: PHP 8.3 (mod_php)

    • Failing state: PHP 8.4 (mod_php)

  • Apps:

    • richdocuments: 9.0.5 (NC32) / updated on NC33

    • richdocumentscode: 25.4.904 (built-in CODE)

Network

  1. No reverse proxy
  2. Apache directly serving Nextcloud
  3. No Apache proxy modules enabled (working setup)

Working configuration (baseline)

  • Apache using:

    • libapache2-mod-php8.3
  • No proxy_* modules enabled

  • Nextcloud Office works normally:

    • documents open

    • editing works

    • no errors in logs


Issue after upgrade

After switching Apache to PHP 8.4:

  • Nextcloud UI works fine

  • Nextcloud Office fails to open documents


Observed error (browser dev tools)

POST /apps/richdocumentscode/proxy.php?req=/cool/.../ws
Status: 400 Bad Request

Additional symptoms:

  • Infinite loading or failure to open documents

  • Some 404 errors on branding/CSS (likely secondary)


Key tests performed

1. CODE endpoints

/apps/richdocumentscode/proxy.php?req=/hosting/capabilities → 200 OK
/apps/richdocumentscode/proxy.php?req=/hosting/discovery → 200 OK

→ Built-in CODE is reachable and responding.


2. WOPI endpoint test

curl -vk https://xxxxx/index.php/apps/richdocuments/wopi/files/<fileid>
→ HTTP 500

→ Indicates failure during document session initialization.


3. Apache modules

  • No proxy modules enabled in working setup:
ls /etc/apache2/mods-enabled | grep proxy
→ (empty).

Conclusion

  • The issue is not related to:

    • Apache proxy modules

    • DNS / internal IP resolution

    • WOPI configuration

    • Nextcloud version (32 vs 33)

  • The issue is specifically triggered when:

    Apache serves Nextcloud using PHP 8.4 (mod_php)

  • The failure occurs during:

    • WOPI session initialization

    • /cool/.../ws connection → rejected with 400

I spent hours debugging, searching the forum, and getting help from AI.

I restored the VM to its pre-update state, but I kept the updated version so I can test it based on your feedback.

If anyone has seen similar behavior or has insight into PHP 8.4 compatibility with Nextcloud Office, I’d appreciate feedback.

Thanks!

What do your logs say? 500 error is going to be logged at Apache error log and/or Nextcloud log level (depending on what is going on).

I had the (potentially) the same issue on my server running NextCloudPi. The easy solution was to restart the machine.

Have you tried a restart?