Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I got this error message when I was installing a plugin: "Unable to locate WordPress Content directory (wp-content)".

I found a solution here: http://wordpress.org/support/topic/cannot-find-content-directory-wp-content

They suggested adding the following code to the wp-config.php file:

if(is_admin()) {
    add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
    define( 'FS_CHMOD_DIR', 0751 );
}

This solution worked for me. My questions are:

a) What does this code do?

b) If I run into the same error on the production server is it safe to use this code?

Thank you.

-Laxmidi

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

The first part (add_filter()) tells WordPress to use the direct-write method. The second part (define()) tells WordPress to apply 0751 permissions to any directory it creates. More information here.

I would not consider using the Direct Write method to be safe to use in a live, public, shared-hosting environment.

Also, it might not - and in fact probably won't - work in a shared-hosting environment.

share|improve this answer
    
Hi Chip, Thank you for the help. I guess I'll use it on my local machine (Mac running WP 3.1.2) and not use it on the production server. –  Laxmidi May 3 '11 at 21:34
add comment

I agree this is a bad idea.Though the permission itself might not be an issue the method is.

751 is a file system permissions (chmod), it means:

User: read/write/execute
Group: read/execute
All: execute

share|improve this answer
    
Hi Wyck, Thank you for the message. –  Laxmidi May 3 '11 at 21:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.