php 7 ignores ini files, but claims to load

Ubuntu 16.04, Lighty 1.4.35, PHP 7.0.4-7ubuntu2 (in a Hyper-V VM)

I browsed all (or at least many) of the other questions about php.ini.


No matter what value I set for any of the directives; ini_get returns does not necessarily return that value. And php´s behaviour doesn´t seem to have anything to do with either of them.

  • no error messages in browsers, although display_errors is On by default. (php_info shows "Off" in the browser and on CLI)
  • full error messages (including notices) are listed on CLI and written to the server log, although the default value for error_reporting excludes E_NOTICE. (And php_info displays the default value, no matter what I put in any php.ini file)
  • all messages are written to the lighttpd/error.log, although log_errors is Off by default. And no matter what I set it to): php_info() says it´s on.

php -h tells, that php -c <path>|<file> can be used to change the ini file path. calling info.php with PHP CLI

  • with no other parameters: Config File Path: CLI, Loaded Config File: CLI
  • with -c /etc/php/7.0/fpm/ini.php: File Path: CLI, Loaded: (none)
  • with -c /etc/php/7.0/fpm/: File Path: (still !!) CLI, Loaded: FPM

It all works well on my old machine (Ubuntu 14.04.4, Lighty 1.4.33, PHP 7.0.7-4+deb.sury.org~trusty+1); but I cannot find anything in the PHP 7 ChangeLog that would explain my problems.

Any ideas while I inspect the other included ini files one by one?


Solution 1:

A simple grep -n error_reporting on the ini file revealed everything:

error_reporting default, development and production settings are described in php.ini around line 105.

I added my setting on line 111.

And there had already been a setting more than 300 lines below that, which overrode my setting.

TILT