Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php_admin_flag[log_errors] = on prevents define('WP_DEBUG_DISPLAY', false); #297

Closed
JacobDorman opened this issue Aug 11, 2015 · 2 comments

Comments

@JacobDorman
Copy link
Contributor

php_admin_flag[log_errors] = on
(11e793b#diff-97894dad9044d33182d3b1ad613c6e20R16)

Any directive type set with php_admin_flag can not be overridden by .htaccess or ini_set().

So if you say, want to configure staging to log errors to file, but not display:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

wordpress tries to ini_set( 'display_errors', 0 ) but is prevented by php_admin_flag

JacobDorman referenced this issue Aug 11, 2015
These settings in our PHP-FPM conf help us achieve our intended goal of
PHP error logging:

* development: log and display all errors
* production: log errors only

Setting `log_errors` is the key here.
@JacobDorman
Copy link
Contributor Author

would changing those lines to php_flag break anything?

@swalkinshaw
Copy link
Member

@JacobDorman not sure would have to test this again. If you're able to that would be great as well.

@retlehs retlehs modified the milestone: 1.0.0 Oct 15, 2015
swalkinshaw added a commit that referenced this issue Dec 28, 2015
Fix #297 - Use `php_flag` vs `php_admin_flag`
primozcigler pushed a commit to proteusthemes/pt-ops that referenced this issue Mar 10, 2016
`php_flag` lets `ini_set` override its value whereas `php_admin_flag`
does not. This restores a bit more control to WordPress and its
debugging constants.
primozcigler added a commit to proteusthemes/pt-ops that referenced this issue Mar 10, 2016
* bringing-up-to-date:
  Added cherry-picking notice to future-me.
  Added TODO commit.
  Replace strip_www with optional redirect to www/non-www
  Added TODO commit.
  Fix roots#353 - Allow insecure curl reqs for cron
  Fixes roots#374 - Remove composer vendor/bin from $PATH
  Added 2 TODO commits.
  Fix roots#436 - Let WP handle 404s for PHP files
  Fix roots#297 - Use `php_flag` vs `php_admin_flag`
  Update CHANGELOG
  Add wp-cli command to enable permalinks when none are set
  Use https://api.ipify.org for IP lookup
  Fix bug in Vagrantfile where VMware provider variable was encapsulated as a string
  Add HTTP/2 notes to README
  WP-CLI role improvements
  Fix CHANGELOG entry regarding roots#435
  Add variable for whitelisted IPs
  Switch to mainline Nginx, replaces SPDY with HTTP2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants