Scenario
I had installed php8 and wordpress 5.6 locally over my computer.
Problem
When I run the wordpress, I get Fatal Error.
Question
Anyone of you facing the same problem and how did you solve it? Thanks
I had installed php8 and wordpress 5.6 locally over my computer.
When I run the wordpress, I get Fatal Error.
Anyone of you facing the same problem and how did you solve it? Thanks
Your PHP 8 installation does not have a mysqli
extension installed.
See possible dupe: Wordpress Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /wp-includes/wp-db.php:1570
I kind of wish WordPress would tell you explicitly that it's missing a usable database extension. The major indicator is the error message itself where WordPress tries to call mysql_connect
which was removed ages ago.
WordPress 5.6 core appears to run correctly on PHP 8. Though, the same might not be true of plugins (yet), so you'll want to test them individually.
[Edit] WordPress's database abstraction is written to use either the mysql
or mysqli
extensions, but the mysql
extension was removed in PHP 7.0. The abstraction library does not support PDO, so even if you have the PDO MySQL driver, WordPress will not use it.
Edit: And to demonstrate a reproduction of the error, I took the same install, but rebuilt my Docker image without the mysqli
extension: