wp-config.php file permissions

I have installed WordPress on my local Ubuntu machine, with standard LAMP configuration and phpMyAdmin. The installation directory is localhost:///var/www/blog.

At the second step of the installation, after I’ve entered the MySQL configuration, the following message appeared:

Sorry, but I can’t write the wp-config.php file.

Current permissions are:

-rw-r--r-- 1 adam adam 2.0K Oct 23  2010 wp-links-opml.php
-rw-r--r-- 1 adam adam 3.2K Nov  1  2010 wp-config-sample.php
-rw-r--r-- 1 adam adam 3.7K Jan  8  2012 wp-trackback.php
-rw-r--r-- 1 adam adam  271 Jan  8  2012 wp-blog-header.php
-rw-r--r-- 1 adam adam  395 Jan  8  2012 index.php
-rw-r--r-- 1 adam adam 3.5K Apr 10  2012 wp-comments-post.php
-rw-r--r-- 1 adam adam  20K May  6  2012 license.txt
-rw-r--r-- 1 adam adam  18K Sep 11  2012 wp-signup.php
-rw-r--r-- 1 adam adam 2.7K Sep 11  2012 xmlrpc.php
-rw-r--r-- 1 adam adam 2.7K Sep 23  2012 wp-cron.php
-rw-r--r-- 1 adam adam 7.6K Sep 25  2012 wp-mail.php
-rw-r--r-- 1 adam adam 2.4K Oct 26 21:40 wp-load.php
-rw-r--r-- 1 adam adam 4.6K Nov 17 17:11 wp-activate.php
-rw-r--r-- 1 adam adam 9.7K Nov 22 11:52 wp-settings.php
-rw-r--r-- 1 adam adam  29K Nov 30 15:40 wp-login.php
-rw-r--r-- 1 adam adam 9.0K Jan 24 22:50 readme.html
drwxr-xr-x 9 adam adam 4.0K Jan 24 22:53 wp-includes
drwxr-xr-x 4 adam adam 4.0K Jan 24 22:53 wp-content
drwxr-xr-x 9 adam adam 4.0K Jan 24 22:53 wp-admin
drwxr-xr-x 4 root root 4.0K Apr  1 14:52 ..
drwxr-xr-x 5 adam adam 4.0K Apr  1 14:55 .

I’ve added a+w permissions to the blog folder:

chmod a+w 

And now everything works, but I don’t know if it’s safe to grant global write permissions to that folder.

Which file and directory permissions should I set on a new WordPress/LAMP installation?

5 Answers
5

Which file and directory permissions should I set on a new WordPress/LAMP installation?

There is no definite answer to this. It varies depending on the server setup. The rule of thumb is to use the minimal permission to make WordPress work on a server. This means to start with 400 (or 600) and go from there, until WP works.

Leave a Comment