Wordpress 5.6 does not support PHP 8?Get the solution ↓↓↓
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.
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
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
Share solution ↓
Link To Answer People are also looking for solutions of the problem: cannot add or update a child row: a foreign key constraint fails
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.