Php.ini has not effect

Nextcloud Server version:
    Hub 9 (30.0.6)
Operating system and version:
    Debian GNU/Linux 12 (bookworm)
Web server and version:
    Apache/2.4.62 (Debian)
Reverse proxy and version _(e.g. nginx 1.27.2)
    none
PHP version:
    8.3
Is this the first time you’ve seen this error? (Yes / No):
    yes
Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    through SSL wget https://download.nextcloud.com/server/releases/latest.zip
Are you using CloudfIare, mod_security, or similar? (Yes / No)
    I am using PiHole

Summary of the issue you are facing:

Strange problem: The Apache2 php.ini stopped affecting the Nextcloud:

The .ini has a memory limit of 3GB but the Nextcloud client states 128MB and the updater also always fails (which seems to be caused by the memory limit). Nextcloud also complains about opcache although it is configured the right way in the .ini and worked before.

The Raspberry Pi did install PHP 8.4 automatically but I changed it back to 8.3 and Apache2 is only configured for 8.3

Steps to replicate it (hint: details matter!):

check settings

If you put a testfile in your webspace, and put:

<?php
phpinfo();
?>

it shows the configuration used, and also the path of the php.ini. If the path is correct, did you restart apache or the if you are not using the apache-module php-fpm or others?

1 Like

php 8.4 will have a different path. And if php is auto upgraded everything will change. You can manually uninstall php8.4 and you can use update-alternatives to manually select which php you want to use as default.

I’m not very firm in this whole thing. Where/how do I put this test file? Apache runs under /etc/apache2/

I did reboot the whole system and I am using FPM

Edit: put the file under /var/www/html/test.php and tried http://pi-cloud.local/test.php but it says File not found.

Edit 2: php --ini returns Loaded Configuration File: /etc/php/8.3/cli/php.ini but this doesn’t seem to affect Apache2 either

Edit 3: solved it: I had changed the directory in 000-default so I had to change it back to html. The test.php returned /etc/php/8.3/fpm/php.ini which I changed and now it’s working after restarting php-fpm. Thank you very much!

2 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.