0

I am developing a plugin. I am getting an error when activating, but I can't find out what is causing the error, even which file is causing the error.

I don't receive an email for the fatal error, and nothing is added to the error_log file.

How can I find out what is causing the error?

Update:

Here's the code I'm using in the main plugin php file for error reporting:

//Turn on error reporting
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
ini_set('log_errors', TRUE);
ini_set('error_log', '/my path/wp-content/plugins/pbcsc_cat_by_sub_cat/errors.log');
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
error_reporting(E_ALL);
error_log('ajet.php starting');
//Set mysqli to report errors
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);

The error message I get when trying to activate the plugin is:

Plugin could not be activated because it triggered a fatal error.
5
  • Did you turn error reporting on? define( 'WP_DEBUG', true ); and define( 'WP_DEBUG_LOG', true ); in your wp-config?
    – rudtek
    Commented Jul 17 at 15:37
  • @rudtek: Yep, and even tried specifying the location for the error log. Commented Jul 17 at 16:26
  • That's a hard one. What error are you actually seeing?
    – rudtek
    Commented Jul 17 at 16:41
  • @rudtek: Added it to the question above, but it's Plugin could not be activated because it triggered a fatal error. Commented Jul 18 at 9:10
  • What host are you with? Some hosts mess with the way debug works - I can't remember which one it was but I had it recently where all of the WP debug methods were ignored and over-ruled and I had to ask the hosting company to enable them. All of my attempts at editing the wp-config.php resulted in no change to the errors being displayed. Commented Jul 22 at 18:37

0

Your Answer

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

Browse other questions tagged or ask your own question.