{"id":739,"date":"2025-04-21T13:39:52","date_gmt":"2025-04-21T05:39:52","guid":{"rendered":"https:\/\/play.datalude.com\/blog\/?p=739"},"modified":"2025-04-21T13:39:54","modified_gmt":"2025-04-21T05:39:54","slug":"error-reporting-settings-in-php-fpm-not-recognized","status":"publish","type":"post","link":"https:\/\/play.datalude.com\/blog\/2025\/04\/error-reporting-settings-in-php-fpm-not-recognized\/","title":{"rendered":"Error reporting settings in php-fpm not recognized"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I've been frustrated by this one several times. If you run an nginx server with php-fpm you'll be used to setting php values in the php-fpm pool file. That should supercede any values in php.ini<br><br>So with some values this works:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>;;; php settings\nphp_flag&#91;display_errors] = off\nphp_admin_value&#91;error_log] = \/home\/bobthebuilder\/logs\/phpfpm.log\nphp_admin_flag&#91;log_errors] = on\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These all work fine. But if you look anywhere on the internet, it tells you you can also set error_logging there. It confidently tells you to use<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php_admin_value&#91;error_reporting] = E_ALL &amp; ~E_WARNING &amp; ~E_NOTICE &amp; ~E_DEPRECATED &amp; ~E_USER_DEPRECATED\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;for example. But this doesn't work! You check and re-check the log files which are scrolling past at nausea-inducing rates. You try altering the values in php.ini, wordpress config files, anywhere you can try. But when you load up phpinfo, it just tells you you're wasting your time. You shout at google gemini a bit, but it tells you the same thing. Maybe you have some formatting errors, it suggests?<br><br>The trick, it seems is to use the numeric values. This works in your phpfpm pool file instead of the command above.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php_admin_value&#91;error_reporting] = 8181<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That's it. And there's a pretty handy page for calculating the masks <a href=\"https:\/\/maximivanov.github.io\/php-error-reporting-calculator\/\">here<\/a>. <br><br>Now wouldn't it be nice if PHP had pre-set log levels so all you have to do is put error_log_level = 3 instead of invoking a bitmask calculator &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I've been frustrated by this one several times. If you run an nginx server with php-fpm you'll be used to setting php values in the php-fpm pool file. That should supercede any values in php.ini So with some values this works: These all work fine. But if you look anywhere on the internet, it tells &#8230; <a title=\"Error reporting settings in php-fpm not recognized\" class=\"read-more\" href=\"https:\/\/play.datalude.com\/blog\/2025\/04\/error-reporting-settings-in-php-fpm-not-recognized\/\" aria-label=\"Read more about Error reporting settings in php-fpm not recognized\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,5,137],"tags":[],"class_list":["post-739","post","type-post","status-publish","format-standard","hentry","category-it","category-security","category-wordpress"],"_links":{"self":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/comments?post=739"}],"version-history":[{"count":1,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/739\/revisions"}],"predecessor-version":[{"id":740,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/739\/revisions\/740"}],"wp:attachment":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/media?parent=739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/categories?post=739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/tags?post=739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}