php.ini
https://www.php.net/manual/it/info.configuration.php
Last active
May 14, 2024 12:07
-
-
Save tresorama/b4bb295e6340d6346650586ade8cefe9 to your computer and use it in GitHub Desktop.
Wordpress snippets
First enable debug. Then test that notice/warning/error are written to log file correctly.
// in wp-config.php
define("WP_DEBUG", true);
define("WP_DEBUG_LOG", true); // write to log file (wp-content/error.log)
define("WP_DEBUG_DISPLAY", false)// write on HTML response when error occur
Add this code and comment/uncomment accordingly, then reload a wordpress page and check te log file.
// in wp-content/themes/xxx/functions.php
// Test WP Debug
// Uncomment to test PHP Notice
echo $unknown_variable;
// Uncomment to test PHP Warning
include ("unknown_external_file.php");
// Uncomment to test PHP Error
unknown_function();
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment