Search code examples
phpwordpressdebugginginternal-server-errorhttp-status-code-500

How to Enable Debugging to Diagnose 500 Internal Server Error with Deprecated Syntax Errors


Description:

I'm currently grappling with a rather stubborn problem on my WordPress website, which manifests as a 500 Internal Server Error. To get to the bottom of this, I'm attempting to enable debugging so I can view detailed logs and identify the root cause of the error. However, upon enabling debugging, my webpage bombards me with the same error message, but on different lines. Version of php is 8.2.7 (Support 64bitové values). The error message is as follows:

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/www/hledampneu.cz/www/akaska.hledampneu.cz/wp-content/plugins/wpforms-lite/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php on line 46

I'm seeking guidance on how to proceed in two main areas:

  1. Enabling Debugging: I would like to know the correct steps to enable debugging effectively so that I can gather detailed logs for diagnosing the 500 Internal Server Error. This includes configuring settings within WordPress and on the server itself.

  2. Resolving Deprecated Syntax Errors: The error messages indicate issues with deprecated syntax, particularly in the file mentioned. I would appreciate help in understanding what's causing these errors and how to rectify them, especially in the context of the given file (ActionScheduler_StoreSchema.php).

Your insights and expertise would be of tremendous assistance in resolving these issues. Thanks in advance!


Solution

  • Best way would be to setup the wordpress page in your local environment and then also setup XDebug. With a XDebug compatible IDE (Like PHP Storm) you can then hook into the code and see what is going on.

    https://xdebug.org/docs/install

    Since you don't say anything about the versions you use (Wordpress, LAMP-Stack). I suggest you use the latest versions.

    Checkout the PHP compatibility chart here: https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/

    Latest WP versions are only running in PHP > 7.4 either with exceptions or as beta-version.

    Taking a short look at your page seems you use WP 6.3.2 and the main problem is located in the plugins wpforms-lite and elementor.

    I would suggest that you first downgrade your PHP version to 7.4 until PHP 8 is fully supported for your WP version and the used plugins.

    If you don't want to do so, then you could also disable the output of PHP deprecation warnings in either your PHP VHost or htaccess as long as the plugins do their jobs.