10.10. Microsoft IIS
PHP CGI Error in IIS
On some PHP installations running as a CGI on Windows IIS a CGI 502 error is received at random. This is a bug in the interaction between PHP and IIS and is not HelpSpot specific. It appears to happen most on fast servers which are under low load. One options is to run PHP as an ISAPI module. However, if you would prefer to keep it as a CGI there appears to be an effective workaround for the issue.
The workaround works by telling Windows to optimize for foreground applications instead of background services. This appears to slow down the processing enough so that IIS doesn't throw an error. Please be aware that this is a system wide setting and will affect the overall speed of your server to some degree. If you change this setting it is highly recommended that you keep close watch on the server afterwards to make sure none of your applications have been adversely affected.
On Windows Server 2003 go to: Start -> Control Panel -> System -> Advanced (tab) -> Performance (settings) -> Advanced (tab) -> and switch "adjust for best performance of" to "Programs". Apply the change and the effect should be immediate.
On Windows 2000 go to: Start -> Settings -> Control Panel -> System -> Advanced (tab) -> Performance (performance options) -> Select "applications". The change should be immediate.
This solution was discovered in the discourse of this PHP bug history: http://bugs.php.net/bug.php?id=9852
Note: that this solution does not always work when PHP is used with the MS SQL extension. When this solution fails while using the MS SQL extension the only solutions appear to be to switch PHP to ISAPI or switch to using MySQL or PostgreSQL.
IIS Crashes every few hours or more, tasks.php takes a significant time to run
An upgrade to .net version 3.0 can partially cause this issue. Note that .net is not used by HelpSpot, but the upgrade causes permission issues which cause IIS to be unstable. This situation can be fixed following the information in this article: http://support.microsoft.com/kb/918041.
If the situation persists after the fix uninstalling .net v2 may be needed using aspnet_regiis.exe -u followed by aspnet_regiis.exe -u started from: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Live Lookup fails to load
This can sometimes be happen when using IIS due to it's low maxQueryString setting. Resources and details on how to adjust that:
- Control Panel > Administrative Tools > Internet Information Services (IIS) Manager
- In the Connections pane, drill down to the relevant site you want to modify. Something Like SERVER > Sites > Default Web Site.
- In the Home pane for Default Web Site, open Request Filtering.
- In the Action pane, click Edit Features Settings.
- Maximum query string defaults to 2048; set it to 10240 and click OK.
- Close IIS Manager, and restart the World Wide Web Publishing Service.
Attachments Do Not Upload to a Network Drive
HelpSpot allows the Attachment Storage System to optionally save to the file system, rather than the database. If you have set the file path to a network drive (typically a path such as "\\path\to\shared\directory") and attachments are not successfully being saved, it is important to ensure proper credentials are set. If the IIS worker processes runs under a user who has permission to write to the network drive and attachments still are not saved correctly, then the Application Default settings may need to be set with the username and password of the user with permission to write to the network drive.
- Within the IIS Manager, select your site from the Connections pane on the left by clicking on it. This is typically labeled "Default Web Site".
- Click the "View Applications" link in the Actions pane on the right.
- Options within the Actions pane will change. Click "Set Application Defaults" with the Actions pane.
- Next to "PhysicalPathCredentials", click the empty field with the smaller button containing three dots(...). This will open a new window labeled "Connect As"
- Choose "Specific User", Click the "Set" button, and enter the username and password of the user who has permission to write to the shared drive.
A. Pictured: Click the "View Applications" link in the Actions pane on the right.
B. Pictured: Set Application Defaults, Choose Physical Path Credentials, Select Specific User, Enter Credentials