DEV Community

Cover image for [Solved]Unable to write to wp-config.php file on linux ubuntu
Chidiebere Chukwudi
Chidiebere Chukwudi

Posted on • Edited on • Originally published at jovialcore.tech

[Solved]Unable to write to wp-config.php file on linux ubuntu

"Unable to write to wp-config.php" is usually a problem you get when installing wordpress on a linux environment. In my case, I wanted to install wordpress locally on linux with the the xampp apache server.

The error is related to the default linux unauthorised read and write or file permissions for that folder where you have your wordpress.

This is a quick solution to fix this issue
On your terminal run the following:
cd into your htdocs where you have your xampp installtion

cd /opt/lampp
Enter fullscreen mode Exit fullscreen mode

Next, change the user username and grouwp ownership from the default root:root to your own username and group

sudo chown -R yourusername:yourusername /opt/lampp/htdocs
Enter fullscreen mode Exit fullscreen mode

Note: remember to replace "yourusername" in the command above with your own username and group. Most of the time, the username and usergroup is same words. e.g jovialcore:jovialcore

Next, change the htdocs folder and all files persmissons to read and write by running the following command :

 chmod -R 777 htdocs

Enter fullscreen mode Exit fullscreen mode

That's all.
Reference: https://stackoverflow.com/questions/43558542/give-user-permissions-to-htdocs-in-ubuntu

I'm on Twitter
Linked too

Top comments (0)