This error is often caused by misconfigured database settings. I would verify your DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST are set correctly in wp-config.php.
https://codex.ww.wp.xz.cn/Editing_wp-config.php#Configure_Database_Settings
DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST are correct , but when i tried in this way , i face this
“Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file to your WordPress installation.”
so what to do ???
- Did you make sure any changes you made were saved to wp-config.php and not wp-config.txt?
- Are the file permissions on wp-config.php set to 644?
- Have you recently moved any files or folders?
- Make sure you have all your database information saved, then you could try deleting wp-config.php, downloading a fresh copy of WordPress and re-uploading the wp-config-sample.php, renaming it to wp-config.php and adding your database information back in.
Do any of those things make a difference?