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

12 2

[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

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay