Quantcast
Channel: Weblog Tools Collection » HOW-TO
Viewing all articles
Browse latest Browse all 15

WordPress, IIS and Plesk “Unable to find wp-content” Woes and Solution

0
0

I tried to help a co-worker with a professional blog for a TV channel yesterday and ran into some weird issues. We host the blog on a Windows 2008 server with IIS and Plesk. The WordPress install from within the Plesk worked fine but ours did not. The “white screen of death” on the install screen was perplexing (more on that at the bottom of this article), but every time he tried to either upgrade WordPress or install or upgrade a plugin or theme, he would receive warnings or failures stating that WordPress was unable to find the wp-content directory. This warning can take various forms but circle around the fact that WordPress did not find the right directory in the expected place.

The obvious and painless solution is to upload the files directly to the server using FTP and then control the blog from within wp-admin. In this case, though I knew the simple solution, I wanted to get to the root of the problem. It turns out that weird permission issues with IIS and WordPress and in some extreme cases such as mine, can be solved with simple but somewhat hidden features to get the desired results.

A Google search revealed that adding a few lines of code to the end of your wp-config.php can solve most issues. As from Firdouss.com guide, try this solution first. Open up your production wp-config.php, find the end of the file and add the following lines at the end. Then save the file, upload to your server and try the process again.

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

If that does not solve your problem, you can use WordPress constants to solve your problem. It turns out (thanks to a comment on the Firdouss.com guide) that there are a host of constants that can be added to wp-config that can fix broken upload and install/upgrade problems among other things. That link to the Codex contains a detailed explanation of the constants and what they should be set to. Please refer to that link since it will continue to be updated. In my case, I had to add the following to the end of my wp-config.php file. I could also have modified the above code to return ftpext instead.

define('FS_METHOD', 'ftpext');

Now in my case, there were other permission issues that had to be resolved. Our Plesk install had a borked permission system and in order for uploads to be deleted after they are unzipped and copied (WP need to switch to a move), I had to also CHMOD the files. So I ended up with the following code at the end of wp-config.

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

Now the uploads/upgrades/installs work fine. YMMV.

As for the weird installation issue, it turns out that when I uploaded the WordPress install files on the server and visited the URI, I got redirected to the following along with a white screen of death with no errors.

http://example.com/index.php/wp-admin/install.php

I needed to change that URI manually to the following for the install to continue. That was all.

http://example.com/wp-admin/install.php

Do you have any other suggestions? Are there any tricks that have helped you get similar issues resolved?


Viewing all articles
Browse latest Browse all 15

Latest Images

Trending Articles





Latest Images