PHP-FPM cannot override error_reporting?

I have a problem that drives me crazy in the last couple of hours: I cannot override the default directives error_reportingon my development machine (Debian 8 + php-fpm 5.6.29 + Nginx / 1.6. 2)

The php packages I use are:

$ dpkg --get-selections | grep php
libapache2-mod-php5             install
php-console-table               install
php5                        install
php5-cli                    install
php5-common                 install
php5-curl                   install
php5-fpm                    install
php5-gd                     install
php5-intl                   install
php5-json                   install
php5-mcrypt                 install
php5-mysql                  install
php5-readline                   install
php5-xmlrpc                 install
php5-xsl                    install

Given the following simple script:

<?php
$initial_value = error_reporting(); // Just read the current value

error_reporting(E_PARSE); // Lets set it to something else.

$update_value = error_reporting(); // Read again.

printf(
  "Initial value: %s\nFinal value: %s",
  $initial_value,
  $update_value
);

if I run it from cli, it works:

$ php test.php
// output: Initial value: 22527 Final value: 4

But if I run this under php5-fpm, the output will be:

Initial value: 32767 Final value: 32767

What I tried:

  • Set the value inside php.ini(and just in case, check all the php.ini files listed in phpinfo();), but nothing.
  • I do not use .user.inifiels (double checked)
  • I tried both with error_reporting(E_PARSE)and ini_set('error_reporting', E_PARSE);. These directives should override INI files, right?

, ini php5-fpm ( , /)

, (display_errors, , ini , ini_set).

, ?

+4
1

php_admin_value. fpm/php.ini fpm/pool.d/* fpm/conf.d/* :

php_admin_value[error_reporting] = E_ALL

, . nginx, :

fastcgi_param PHP_ADMIN_VALUE ...
0

Source: https://habr.com/ru/post/1667016/


All Articles