Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to Solve Common Problems in Wordpress on Windows Server  (Read 2567 times)

0 Members and 1 Guest are viewing this topic.

lathu_official

  • Guest
How to Solve Common Problems in Wordpress on Windows Server
« on: December 30, 2013, 01:51:24 pm »
Setting up and running Wordpress on a Windows Server isn't always as simple as its Unix counterpart. Lets have a look at some of the common problems and their solutions.

IIS Folder Permissions

The most common and simple way to install Wordpress on a Windows server is to use the Web Platform Installer. This approach works great but it doesn't handle the folder permissions Wordpress will need to run smoothly.

Wordpress will need special permissions in order to update itself, install plugins and themes and access file writing functions.
Open Windows Explorer and locate the root folder that Wordpress is installed in. Right click this folder, select Properties and click the Security tab. From here, choose Edit then Add. The following users must be added and given FULL ACCESS permissions: IUSRS & IIS_IUSRS.
Once added, Windows will apply these user permissions to all child folders and those created in the future by Wordpress.


Default Document Type & Directory Browsing


IIS does not by default add index.php to the list of accept default documents. IIS will also not allow for directory browsing. This is critical for Wordpress to run correctly. To solve this, locate the web.config file in the root of the hosting space. If it does not exist, create one and add the following commands.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <directoryBrowse enabled="false"/>
    <defaultDocument>
      <files>
        <clear/>
        <add value="index.php"/>
        <add value="Default.htm"/>
        <add value="Default.asp"/>
        <add value="index.htm"/>
        <add value="Default.aspx"/>
      </files>
    </defaultDocument>
    <rewrite>
      <rules>
        <rule name="wordpress" patternSyntax="Wildcard">
          <match url="*"/>
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
            </conditions>
          <action type="Rewrite" url="index.php"/>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>



Slow Page Loading



I find that pages load very slowly when using the default Wordpress configuration. Luckily, this is an easy fix. Open the wp-config.php file in the root of the Wordpress installation folder. Locate the following line of code:
define('DB_HOST', 'localhost');
I'm not entirely certain why but this causes a very noticeable delay in page loading. Change this code to the following:
define('DB_HOST', '127.0.0.1');
Ah , that's better, now your pages are loading nice and fast.


Maximum File Upload Size

"This file exceeds the maximum upload size for this site". If you have not yet encountered this error, chances are you will at some point. If you used the Web Platform Install to install PHP for Windows, the maximum file upload size will be set to 2 megabytes. For most users, this is insufficient. This is also an easy fix.
Locate the folder PHP was installed in. It is typically found at C:\Program Files (x86)\PHP\v5.x\. Locate the following variable:
upload_max_filesize = 2M
Change it to the following:
upload_max_filesize = 10M (or whatever size you need it to be)
Upload away!


--------
Thanks.