IIS 5 & IIS 6
Last post May 10, 2012 05:58 AM by Ibran Siagian
May 13, 2011 04:59 AM|Ibran Siagian|LINK
I have a problem with a php application timeout running on IIS. Firstly, I am completely new to both technology, so I'm not really sure which or where configuration and etc, should be fixed regarding to the problem. My problem is that the application suddenly
timeout in random time limit when a form submitted. I've tried increasing some configuration in php.ini, fastcgi settings, changing php temp folder permission, also CGI (timeout value in IIS M.Console), but none seems solve the problem. I am using PHP 5.3.6
nts build vc9 on IIS 7, OS: Winserv 2008.
Here's the configuration I've been changed
max_execution_time = 400
max_input_time = 240 default_socket_timeout = 600
session.cache_limiter = nocache
session.cache_expire = 3600
session.gc_probability = 1
session.gc_divisor = 3600
session.gc_maxlifetime = 3600
output_buffering = 8192
Activity Timeout = 600
Idle Timeout = 700
Request timeout = 600
CGI time-out = 01:00:00
Please help me and thank you so much.
May 13, 2011 06:01 AM|HostingASPNet|LINK
You should also check the application pool timeout.
May 13, 2011 07:52 AM|Ibran Siagian|LINK
I try to increase the application pool time-out from the default value = 20 to 30 minutes, still the problem's not solved.
May 13, 2011 08:51 AM|vijaybhaskarReddy|LINK
May 13, 2011 09:32 AM|Ibran Siagian|LINK
I can't find a time-out entry on webconfig file. should I add it manually? can you give me an example to do so?
here's my web config:
<?xml version="1.0" encoding="UTF-8"?>
<httpErrors errorMode="Detailed" />
<httpRedirect enabled="false" destination="https://tower.me.com" exactDestination="false" childOnly="false" />
May 18, 2011 08:24 AM|Leo Tang - MSFT|LINK
It seems you already configured Timeout settings properly. Could you please post the detailed error information here?
May 25, 2011 10:29 AM|Ibran Siagian|LINK
there's no error report shown up on the browser, or should I post the php-errors.log instead?
May 25, 2011 01:28 PM|HCamper|LINK
Yes, Either Check the errors in php_error.log or post the contents of php_error.log.
Change the php.ini to show errors aka Developer Mode change this back to Production Mode after fixing php.
It is very likley the timing problems have nothing to do with time specific configuration.
It is more likey the delay problems are related to other php.ini settings:
A) Incorrect Time / Zone configuration in php.ini.
B) Having missing or incorrect selections for extensions in php.ini.
Please test the php using command line >php -h displays help php -i shows information.
Test the php using >php test.php then check the php at the IIS Server Browse using http:// localhost / test.php.
A guide for php settings from IIS Net library
Jun 09, 2011 05:35 AM|Ibran Siagian|LINK
Thanks for your guidance, I've changed the time/zone configuration same to the server's configuration, also fixing incorrect selections for extensions. Still the problem not solved.
I was using 5.2.14 before, and the problem appeared when I upgrade PHP to 5.3.
Should I try to go back to 5.2.14 version?
or could you give me another hint?
Jun 09, 2011 06:12 AM|HCamper|LINK
Hi @ Ibran,
Ok. So you fixed some issues. Yes I still have an idea or two.
Run the PHP installation to be at C:\Program Files (x86)\PHP52 and check the proper extensions and other options.
Then make a backup of the current php.ini file then uninstall PHP and run PHP for the install to be at C:\Program Files (x86)\PHP53
and again check the proper extensions and other options.
Then use enable per site PHP configuration
Jun 24, 2011 04:44 AM|Ibran Siagian|LINK
I'm now downgrading the PHP into 5.2 version, still no luck. The problem's still there, so now I'm convinced the problem appeared not because I'm upgrading the PHP version. I've checked the php errors log, but no hint in there too, the most of it is related
to coding errors. :)
Jun 24, 2011 05:08 AM|HCamper|LINK
I think that the problem maybe you have some left overs including additional php.ini or pear.ini files
in the Windows directory along with duplicate or incorrect Handlers and Mappings in IIS Server.
So the best thing is do a clean-start by uninstall of any PHP installations then remove
the PHP installation folders and any php.ini,pear.ini files in Windows directory remove any php handlers and mappings
in IIS Server and any Web Sites.
Then use this post http://forums.iis.net/t/1178967.aspx as a guide for installation and include the PHP Manager to control
the PHP settings and configuration.
I think with a clean-start and using the PHP manager you can PHP going.
Hope this helps,
Jul 11, 2011 03:36 AM|Ibran Siagian|LINK
I have uninstalled the PHP and make assure that I removed the php.ini/pear.ini manually. I have also removed all handlers related to the php installation, then doing the re-installation process using WPI.That's include the sql server driver installation
for php, then managing php registration to IIS Server through php manager, and leaving all other php settings to it's default. Still the unexpected timeout occur.
Could it be a coding problem, or you have something else to suggest?
Thanks for the helps.
Jul 11, 2011 05:43 AM|HCamper|LINK
So you have a current version of PHP that works for the IIS Server.
During all the various changes you have not posted IIS Server log errors so that would help in diagnostics.
Additionally you have not posted the PHP code section that fails which may also be an issue.
Where was the PHP code from and is it part of a larger Application or system ?
Does the PHP code or application depend on access from a database server ?
With out knowing more about the PHP code or errors it is hard to answer.
Jul 11, 2011 10:03 AM|Ibran Siagian|LINK
thanks for sticking to this thread.
Where can I find the IIS errors log? is it the log files placed on inetpub/logs folder?
I'm not posting the php section code, because the timeout mostly occur on form submitting, which is spread across the app :), so I'm hardly decide which one the section code should I post. What I thought is, maybe the timeout occur by a certain php function
The application is indeed accessing database server, It's used for storing and retrieving data. I'm not so sure whether the connection to the db server take part in the problem.
I try to install the application in my laptop, which is running windows 7, and the same db server as in my production server, the unexpected timeout never occur, I've tried to use almost same settings I'm running on my laptop to the production server, still
no luck yet.
Jul 11, 2011 10:40 AM|HCamper|LINK
The logs are stored in the %systemdrive%\inetpub\logs\Logfiles collection.
You may find that getting Log Parser from the Microsoft Download Center will help with the logs
check this http://forums.iis.net/p/1155654/1895114.aspx#1895114 .
If you check the logs for where the errors are occuring and post results
the quest can continue.
Jul 29, 2011 06:00 AM|Ibran Siagian|LINK
I was trying to learn how to use log parser, as you suggest. During the time I've also remarked some php code added by my ex-teammate regarding of some issues when we execute our application on some security assessment process, and the unexpected timeout
never happened again regarding of our user reports. Honestly I don't exactly knows what the code doing and can not surely tell that the problem's gone. Can I post it here? so you could check it out and probably help me for some info.
Jul 29, 2011 06:14 AM|HCamper|LINK
Well that is better news.
Yes you can post the php code.
I suggest that you not post the raw php code in the forum.
I suggest that if you have Skydrive or Public Sharing location put the php code in a zip archive
and I will take a look at the code.
I will not fix the code just make suggestions.
Jul 29, 2011 09:21 AM|Ibran Siagian|LINK
this is the remarked line of code. I just PM-ed you the link to the source file.
I post the code so the others might point me something if they have different thoughts about it.
($_SERVER['REMOTE_ADDR'] != $_SESSION['PREV_REMOTEADDR'] AND $_SESSION['PREV_REMOTEADDR']!='')
session_destroy(); // destroy all data in session
Aug 01, 2011 04:47 AM|Ibran Siagian|LINK
Oya could you guide me how to display php errors on the browser when the server encountered a problem.
I have changed featured settings on Error Pages section in iis manager to detailed errors and set error_reporting property on php.ini to E_ALL & ~E_NOTICE, but the server always return the 500 error page when it countered programmatic errors.
Did I miss something?
Aug 01, 2011 02:17 PM|HCamper|LINK
Look at this
http://learn .iis.net/page.aspx/765/improve-php-error-messages-in-iis-7/ guide
Aug 02, 2011 10:49 AM|Ibran Siagian|LINK
Thanks a lot for the link.
Feb 01, 2012 03:36 PM|HCamper|LINK
Have you updated to the latest release and version of PHP ?
http://forums.iis.net/1104.aspx FastCGI Forums.
http://forums.iis.net/t/1186508.aspx Guides and information.
The remarked line of code looks ok to me.
Update to the latest Version of PHP--How-To-Information:
IIS 7 - FastCGI - The Web Platform-IIS 7-Information and Guides:
http://learn.iis.net/page.aspx/773/how-to-install-the-microsoft-web-platform-for-php/ How-To Install.
http://forums.iis.net/t/1178116.aspx Trouble Shooting
Issues or problems check the Trouble-Shooting information.
fastCGI vbulletin eaccelerator php
php 5.2.3 iis error ini error_reporting display_errors log_errors
FastCGI IIS Application
FastCGI PHP IIS x64
iis 6 fastcgi rails
HTTP Error 404 - File or directory not found.
fastCGI script errors
fastcgi php iis 32
fastcgi install error problem
FastCGI Plesk Windows PHP
IIS 6 fastcgi
FastCGI Error Log
no input file specified
php with both fastcgi and isapi
FastCGI error Access is denied
May 10, 2012 05:58 AM|Ibran Siagian|LINK
thanks for the reply,
the problem is already fixed by current time, and thanks again for your support.