PHP error_reporting - where on earth is it set?

  • i-MSCP 1.4.3, Debian 9.0.


    I'm trying to turn off PHP 5.6 deprecation warnings while developing a custom plugin that goes into the control panel (URL: http://panel.fake-hosting-company.com:8880/[plugin-name]/domains).


    phpinfo() tells me that the current value is 32767 and that the loaded php.ini file is: /usr/local/etc/imscp_panel/php.ini, and that the configuration file path is /etc/php/5.6/fpm. It also lists a bunch of additional ini-files under that directory.


    I've meddled with the error_reporting variable in /usr/local/etc/imscp_panel/php.ini and restarted the panel in between, but the setting still remains 32767.


    I've looked for the string "error_reporting" in the entirety of /etc/php/5.6/fpm but there, only finding it in /etc/php/5.6/fpm/php.ini, where I've also meddled with it, with the same results.


    So my question is rather simple; how on earth do I change the error_reporting variable on a fresh install?


    Thanks in advance.


    EDIT: The weird thing is that changes to the variable always_populate_raw_post_data work if it is changed in /usr/local/etc/imscp_panel/php.ini and the panel restarted.

    Edited once, last by Teekin ().

  • Hello,


    try to restart the PHP-FPM process and check again!


    You can do this on Debian OS with /etc/init.d/php5-fpm restart


    For the future - please give us always full informations of your distro,.... according to our Reporting rules - Reminder


    Best regards.

    Support Infos: I-MSCP Version: 1.5.x / Distro: Debian Stretch / PHP: 7.1.27 - FPM / I-MSCP Plugins: Let´s Encrypt + PHPSwitcher (latest Versions)

  • @FloRet88


    You can do this on Debian OS with /etc/init.d/php5-fpm restart

    We are talking about PHP FPM instance of the control panel which is not the same as the one used for customers. Thus, the command is: service imscp_panel restart.


    Furthermore, you should really avoid invoking scripts from the /etc/init.d directory which are those for sysvinit ;) The service(8) command must be used in place.


    @Teekin


    You shouldn't edit the php.ini file that belongs to the control panel because your changes will be overriden by the i-MSCP installer on next update or reconfiguration. Also, you should edit the FPM pool configuration file instead of the php.ini file.


    Regarding your problem, you can set the error reporting level at runtime. That is what we do for the control panel and that explains why you're seeing the same value, whatever the value set into the php.ini file because the value is immediately overridden by our script. See https://github.com/i-MSCP/imsc…library/imscp-lib.php#L22


    Don't forget that the scripts from i-MSCP plugins are included. See https://github.com/i-MSCP/imsc….x/gui/public/plugins.php

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Thanks for the response!


    Using Debian 9.0 and i-MSCP 1.4.3.


    I tried: service php5.6-fpm restart (and systemctl restart php5.6-fpm)


    Still didn't change anything, no matter which php.ini file I edit.


    EDIT: Didn't see Nuxwin's post until after I wrote this.

  • Nuxwin: Thanks. I'll do it that way, then. You're right about how to invoke the scripts, of course.

  • @Teekin


    I forgot: opcache is enabled for the control panel. Thus, for development time, you should disable it in the /usr/local/etc/imscp_panel/php.ini file of the control panel and run: service imscp_panel restart. If you do not so, you'll not see your changes till you restart the imscp_panel service. For performance reasons, we have configured opcache to not track modification of files.


    See also: http://php.net/manual/en/opcac…cache.validate-timestamps

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206