Fix Unable to write to wp-config.php

While Installing WordPress on Mac, you will encounter this error with message “Unable to write to wp-config.php file. You can create the wp-config.php file manually and paste the following text into it.” 

Unable to write to wp-config file
Unable to write to wp-config file

To Fix this error, 

  • First go inside Applications > XAMPP > xamppfiles >htdocs > wp-config.php
  • Then open wordpress folder inside htdocs folder.
  •  There you will find wp-config-sample.php file. 
wp-config-sample.php file inside wordpress.
wp-config-sample.php file inside wordpress.
  • Now rename this wp-config-sample.php into wp-config.php. 
  • Then open this file in VSCode or any code editor. 
rename into wp-config.php
rename into wp-config.php
Open wp-config.php in VSCode
Open wp-config.php in VSCode
  • Now, just copy the file Configuration rules for wp-config.php from the error page as highlighted below. Copy all part by just selecting with Ctrl + A. 
Copy configuration rules for wp-config.php:
Copy configuration rules for wp-config.php:
  • And paste it inside wp-config.php.
Paste Configuration rules for wp-config.php.
Paste Configuration rules for wp-config.php.
  • Now just save the file. Then you are good to go. 
  • Just click on run the installation. 
Run the installation
Welcome Page

Now you are good to go for further installation. 

For full installation of WordPress : https://codewitharjun.com/install-wordress-on-mac/

Buy Me a Coffee

2 thoughts on “Fix Unable to write to wp-config.php”

  1. I was recommended this website by my cousin I am not sure whether this post is written by him as nobody else know such detailed about my difficulty You are wonderful Thanks

  2. I am not sure where youre getting your info but good topic I needs to spend some time learning much more or understanding more Thanks for magnificent info I was looking for this information for my mission

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top