0

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?

2
  • 1
    stackoverflow.com/questions/35265082/… might point you in a helpful direction, but not sure. Commented Nov 9, 2018 at 13:28
  • I know it's not your question, but it is a problem. Please consider using a better editor, because I have a parse error at most once per year using phpstorm. Commented Nov 9, 2018 at 13:28

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

1 Comment

Cool thanks a lot - works great! I figured out the syntax and added it to your answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.