• Hi,

    I have recently installed WordPress with Xhampp on my machine(localhost) after configure DB when i have tried to run WordPress got the following error :

    “There has been a critical error on this website.”

    Please assist.

    BR

    • This topic was modified 2 years, 10 months ago by Jan Dembowski.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Enable the debug log and then check the log file for errors details.

    Dion

    (@diondesigns)

    The current version of XAMPP is bundled with PHP 8.1, but the current 5.8 release of WordPress is not compatible with PHP 8.1. Make sure to use a version of XAMPP that bundles PHP 7.4 or 8.0 instead. For many reasons I would suggest using a version of XAMPP that bundles PHP 7.4.

    To the original poster, locate your wp-config.php file in your wordpress root directory, open in a text editor like notepad and find the line that says DEBUG=false, change that to true. Refresh your webpage and you will get a read out of errors that it is encountering. A critical error could be anything, but it most likely comes from the 8.1 error in the way it connects to mysql. I posted a link to a fix for that with example code. Then after that you will probably get another error telling you that there are no tables present in the database, you will need to pass the flag mysql_native_password in MySQL. The latest versions of both PHP8.1 and MySQL8 made code change that seems to conflict with latest version WordPress. Again these are just simple one line modifications that is part of any server administration.

    I have heard several times that the latest version of WP is not compatible with php8.1. I am running it without errors, although I will admit there was the one modification that had to be addressed. This was a change in reporting with mysql database, a single line of code fixed the problem. So its not even that PHP is compatible with wordpress, its simply the way it interacts with Mysql.

    @hairpuller Thank You So Much. It is working.

    Hello @faisalt, did the advice provided in the comments above work for you as well? It seems to have worked for @bluecerallp.

    Did you enable the WordPress debug mode? Was there something something helpful in the debug.log file? Did the problem go away by simply switching to PHP 7.4?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Critical error on my site’ is closed to new replies.