[BlueOnyx:21529] Re: PHP Limits for PHP FPM

Michael Stauber mstauber at blueonyx.it
Thu Nov 16 12:15:06 -05 2017


Hi Jochen,

> what about settings like: php_flag[display_errors] = off>
> I would like to disable display_errors for one vsite but the GUI doesn't
> offer such setting.

In the base directory of your virtual site you should find a php.d
directory.

Example: /home/sites/www.test.com/php.d/

In that directory create a new file. The name doesn't matter, but it
must end with *.ini

Into that file put your PHP flags as if you wanted to add them to an
.htaccess file or otherwise wanted to use them in Apache context. In
your case, put this into the file:

php_flag display_errors off

Then go to the GUI of the Vsite in question and navigate to "Services" /
"Web." Simply hit save there and it will do the following:

Any *.ini in php.d will get parsed. Unless it overrides a GUI
configurable item the contends of the custom *.ini files will go into
the <VirtualHost> container of the Vsite, into php.ini if suPHP is
enabled or into the PHP-FPM pool file if PHP-FPM is enabled.

So yes: It will put it into your /etc/php-fpm-7.1.d/vsiteXY.conf as
well, although it changes the formatting a bit to make it work in
PHP-FPM context:

; From /home/.sites/28/site1/php.d/:
php_flag[display_errors] = off

> Will it be overwritten if I set it manually in
> /etc/php-fpm-7.1.d/vsiteXY.conf ?

Yes.

Unless a config file indicates otherwise in a comment: Any changes put
into config files might get overwritten whenever the GUI needs to update
something. To compensate for this we usually provide alternative means
where you can put custom additions. Such as the
/etc/httpd/conf/vhosts/siteX.include files or the php.d directory, which
are safe from GUI mandated changes.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list