cronoklee
cronoklee

Reputation: 6712

Enable display_errors in .htaccess using `php-fpm` execution mode?

When PHP is executing in cgi or mod_php mode, we can disable error reporting in php.ini and enable it on a per-directory basis using a .htaccess file in any directory we want.

php_flag display_startup_errors 1
php_flag display_errors 1
php_flag html_errors 1
php_value error_reporting -1

Doing it in the php script script itself is useless because it breaks on php parse errors which are very common.

How can I do the same thing when running php-fpm execution mode? Is it possible?

Upvotes: 0

Views: 1828

Answers (1)

exussum
exussum

Reputation: 18560

When using fpm PHP scans for a ini file in each directory

http://php.net/manual/en/configuration.file.per-user.php

Default is .user.ini

You should be able to put the same config in there but with the same syntax as php.ini:

display_errors = On
display_startup_errors = On
html_errors = 1
error_reporting = -1

Upvotes: 2

Related Questions