One Last Problem to Overcome with IIS

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
nickka
Forum Newbie
Posts: 10
Joined: Mon Nov 17, 2008 5:40 pm

One Last Problem to Overcome with IIS

Post by nickka »

I have spent a great deal of time getting my PHP web site working with IIS and Sql Server 2005.

The last problem that I need to fix is that of IIS. If a Session expires or any error happens the web site goes down and the only way to get it back up again is to do a iis_reset on the IIS server. I see a HTTP Error 500 Internal Server Error.

I am not seeing any errors in the web site code but sessions do expire and I need to fix this.

These are the last few entries in the IIS log file:
  • 15:15:04 127.0.0.1 GET /rut/category_list.php 200
    15:15:16 127.0.0.1 GET /rut/phrase_view.php 200
    15:15:23 127.0.0.1 GET /rut/category_list.php 200
    15:15:27 127.0.0.1 GET /rut/phrase_view.php 200
    15:15:37 127.0.0.1 GET /rut/category_list.php 200
    16:20:32 127.0.0.1 GET /rut/main_menu.php 500
    16:20:56 127.0.0.1 GET /rut/ 302
    16:20:56 127.0.0.1 GET /rut/index.php 500
    16:31:14 127.0.0.1 GET /rut/ 302
    16:31:14 127.0.0.1 GET /rut/index.php 500
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: One Last Problem to Overcome with IIS

Post by Doug G »

Check the event logs on the server. It sounds like you have some bad code that's causing the iis thread to crash.
User avatar
airy
Forum Newbie
Posts: 20
Joined: Fri Jul 11, 2008 2:53 am

Re: One Last Problem to Overcome with IIS

Post by airy »

is really a big problem that php session doesn't work well with iis
so the best way is use apache,it's simpler and better

php's session is base on read/write tmp file,check all the values about session in php.ini
nickka
Forum Newbie
Posts: 10
Joined: Mon Nov 17, 2008 5:40 pm

Re: One Last Problem to Overcome with IIS

Post by nickka »

Apache is not an option.

I started the web application and logged in and then let it set for over an hour. When I came back I selected a link to the home page and everything worked and I was still logged in. Now I can't duplicate the problem.
nickka
Forum Newbie
Posts: 10
Joined: Mon Nov 17, 2008 5:40 pm

Re: One Last Problem to Overcome with IIS

Post by nickka »

I finally got it to fail after again letting it sit for a while. I looked in the event viewer and there are zero exception.
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: One Last Problem to Overcome with IIS

Post by Doug G »

Well, all I can say is when installed and configured correctly php will work fine with IIS. My guess is still that you have some code somewhere that's causing some kind of memory leak or something causing the IIS thread to run out of resources and crash. IIS has some isolation modes you might want to try that might help you isolate the problem. Review exactly how you installed PHP on the web server, maybe something is configured wrong. Run phpinfo() and check that necessary modules are loaded.
nickka
Forum Newbie
Posts: 10
Joined: Mon Nov 17, 2008 5:40 pm

Re: One Last Problem to Overcome with IIS

Post by nickka »

As I understand it, IIS and PHP have a threading conflict. Would installing FastCGI on the IIS server fix this problem?
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: One Last Problem to Overcome with IIS

Post by Doug G »

nickka wrote:As I understand it, IIS and PHP have a threading conflict. Would installing FastCGI on the IIS server fix this problem?
I'm not aware of defined "issues". For myself I've always used isapi php and on low-usage machines have never had problems. My hosting company has provided php on windows IIS servers for years, I don't know how they set it up or what problems they may have overcome, but they have well over 100K customers many happily running php/mysql apps on IIS servers. http://www.crystaltech.com
wcoleman
Forum Newbie
Posts: 1
Joined: Mon Jan 26, 2009 10:16 am

Re: One Last Problem to Overcome with IIS

Post by wcoleman »

It's a good idea to use FastCGI to run PHP, a lot more stable than ISAPI or CGI. Make sure they're using PHP build 5.2.6 or greater as that will be a lot more performant than previous versions.

If you're on IIS 7/Windows Server 2008 you could use Failed Request Tracing to get a better idea on what's going on - (http://learn.iis.net/page.aspx/266/trou ... g-in-iis7/)

Otherwise you could have a look here for more information - http://www.iis.net/php
Post Reply