Unknown column 'wp_' in 'field list' when running WordPress on PHP 8.1 wordpress compatible

937 Views Asked by At

Unknown column 'wp_' in 'field list' when running WordPress on PHP 8.1

I installed xampp and then WordPress. After submitting database info, i am getting Critical error.i found that wordpress is not compatible for PHP 8.1 so how to shift for older version of PHP on xampp.

"PHP Fatal error: Uncaught mysqli_sql_exception: Unknown column 'wp_' in 'field list' in C:\xampp\htdocs\my_php_81_folder\normal_local_site\wp-includes\wp-db.php:2056 Stack trace: #0 C:\xampp\htdocs\my_php_81_folder\normal_local_site\wp-includes\wp-db.php(2056):......."

1

There are 1 best solutions below

0
On

Will I tried And YAY!! therefor see the solution that i come with:

1- Go to Download WordPress from HERE!!!!!! then under On my computer select win/mac/Linux then go down and download the one that work with your operating system.


2- Then install It's simple
Noties: WordPress will install phpmyadmin and Apache, therefor it will not need Xampp. It's a stand alone


3- copy the wordpress files from the installation

C:\Bitnami\wordpress-5.8.3-0\apps\wordpress\htdocs
To
C:\xampp\htdocs\wordpress

and then edit the wp-config.php in xampp copied wordpress.

in the wp-config.php

/** The name of the database for WordPress */
define( 'DB_NAME', 'bitnami_wordpress' );

/** MySQL database username */
define( 'DB_USER', 'bn_wordpress' );

/** MySQL database password */
define( 'DB_PASSWORD', 'Go_Hacker_Nothing_to_see_here XD' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

save it.


-4 edit the User's and the GRANT in the xampp phpMyAdmin Login then go to DB called phpmyadmin => PRIVILEGES => new User
PRIVILEGES

add the user you saw in define( 'DB_USER', 'bn_wordpress' ); and then add the same paswoord you putted in wp-config.php => Go_Hacker_Nothing_to_see_here XD


5- go to wordpress phpmyadmin, for me it was http://127.0.0.1:81/phpmyadmin/
Login as root + the password that you set on wordpress installation.
Go to Database bitnami_wordpress then export as .sql then go. export
6- go to xampp phpmyadmin Login as root or whatever then add new Database and call it as same as in the wp-config.php define( 'DB_NAME', 'bitnami_wordpress' );
With this database selected go to import "Next to export" and select the .sql file from your downloads folder.


-7 edit the port in table= wp_options for home and siteurl or just put them as http://localhost/wordpress/


8- with the bitnami_wordpress database selected go to PRIVILEGES then the wordpress user that you created select edit-PRIVILEGES then go to Database next to global and select the database you created for wordpress and press go. then select all and go.

edit-PRIVILEGES

enter image description here


9- in the wp-config.php edit this

define('WP_TEMP_DIR', 'C:\Bitnami\wordpress-5.8.3-0/apps/wordpress/tmp');
To
define('WP_TEMP_DIR', 'C:\xampp\htdocs\wordpress\temp');

Dont forget to create the file there
10- Go To http://localhost/wordpress/wp-admin Login with the setup username and password, and delete all post in there!
11- Go to sittings then permalink and set Common Settings to Plain


**BTW:**WordPress Can Not be Installed With Xampp higher than 8.0.14
So if you want it to be with xampp Download 8.0.14 and uninstall the old one


BTW: you can uninstall wordpress we dont need it anymore
If you want to ask why all of that!!. i will till you because the MySQL server from the wordpress instalation is extremly slow and you dont want to run 2 port and 2 MySQL


Let me know what you got :)