Nextcloud ignoring php settings

Numbers

Nextcloud version: 18.0.4
Operating system and version: Ubuntu 16.04.6 LTS
Apache or nginx: nginx/1.17.3
PHP version: 7.2.31

The issue you are facing:

I have made a fresh manual nextcloud install, and everything seems to be working fine. I am now trying to address the warnings on the settings/Overview page:

PHP does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response. Please check the installation documentation for PHP configuration notes and the PHP configuration of your server, especially when using php-fpm.
The PHP memory limit is below the recommended value of 512MB.

If I go to the settings/System page, the PHP values are:

Version:  7.2.31
Memory Limit:  128 MB
Max Execution Time:  3600
Upload max size:  2 MB

I have edited my /etc/php/7.2/fpm/php.ini file to have the following:

memory_limit = 512MB

And restarted nginx. However, nextcloud doesn’t seem to recognize that change. The same thing seems to be happening after I edited my pool.d/www.conf file to address the getenv("PATH") issue. One potential confounding factor is that my ubuntu install has a few PHP versions installed. I am forwarding the right version on my nginx server block configuration file by setting:

upstream php-handler {
    server unix:/var/run/php/php7.2-fpm.sock;
}

Which seems to be fine since nextcloud is seeing PHP version 7.2.
Otherwise, I am stumped where to look at to address this. Anyone has any ideas?

You can check which php.ini file is used on your system by creating a info.php file and storing it in your webroot folder. Simply create a file named info.php in your webroot (probably /var/www/html), paste the following code lines into the file and save.

<?php phpinfo(); ?>

After that you can access the file and gain the information about your php-configuration via your browser under http://your-ip/info.php.
This will probably help to find out which php.ini file ihas to be updated.

regards
Gregor

Hey,
Did you try to restart php ?
sudo systemctl restart php*

Did you use MB as the unit for memory_limit ? On my Ubuntu, there is only M behind the number :slight_smile:

Don’t I feel silly. Yeah, restarting php is all it took.