Unable to locate WordPress Content directory (wp-content)
This error arised from the installation of a plugin within the dashboad where the permissions where not setup correctly on the web server. First the permissions on the directory need to be set to
$ chmod 07550on the wp-content directory and folders within.
After doing some more research regarding installing plugins I came across a nice piece of code to allow plugins, updates and themes to be installed without giving the server credentials each time. I see a security issue in both situations. Figure out the best solution for your situation.
Add the following code at the end of your wp-config.php file.
/** Override default file permissions */
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
}
This snippet override the default file permissions in response to the problem of the core update function failing when needing a username and password for ftp or sftp.
From now on, You can install new plugins in the dashboard without inputting the ftp information!
![[Return to HOME] web design solutions](/images/logo_body.jpg)