Unable to locate WordPress Content directory (wp-content).

by Hui Wang

This error arised from the installation of a plugin within the dashboad where the ftp information is needed. I am currently using byethost.com as my web host.

I found that someone here is talking about the similar problem. For this moment, I have just figoured out that error is generated by the file

wp-admin/includes/class-wp-upgrader.php in line 48.

It may be a server configuration problem or a WordPress bug. Get some ideas?

Continued…

Hello, everyone. I am very glad to give you the solution which work for me. Many thanks for mcarretero!

Add the following code at the end of your wp-config.php file.

/** Override default file system method*/
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
}

Broadly speaking, this piece of code set the file system method to be direct which means that php scripts(in our case, wordpress) could creat and remove files directly if you get connected. In a result, we could install plugins without ftp connection.

Please let me konw wheather it works for you.