?
Solved

PHP 5.3.5 installation on IIS7 (Win Web Server 2008 R2) generating 500 Internal Server Errors

Posted on 2011-03-16
7
Medium Priority
?
1,466 Views
Last Modified: 2013-12-13
I'm trying to install PHP 5.3.5 on Windows Web Server 2008 R2. I've installed PHP plenty of times in the past and never had an issue with it, but this is my first time installing it on a Windows 2008 system. When my first attempt failed (I kept getting a 500 Internal Server Error on a PHP file that just contained <?php phpinfo(); ?>), I reverted the machine back to its post-OS-install state and tried again by following the instructions at http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/ and http://www.php.net/manual/en/install.windows.iis7.php

Same problem. After completing the installation process as described on these pages, the phpinfo() file that I attempt to open in my browser throws a 500 Internal Server Error. If I test it from the command-line by running php-cgi.exe on my test PHP file, it works fine there. Also, if I just test a file that contains an echo statement in it, that works in the browser without generating a 500 error. Why the hell would phpinfo() be causing a 500 error?

I took it a step further and dumped the result into an HTML file:

php-cgi.exe c:\inetpub\webpublic\phpi.php > c:\inetpub\webpublic\phpi.html

It just generates a warning:

PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone setting
s. You are *required* to use the date.timezone setting or the date_default_timez
one_set() function. In case you used any of those methods and you are still gett
ing this warning, you most likely misspelled the timezone identifier. We selecte
d 'America/New_York' for '-4.0/DST' instead in C:\inetpub\webpublic\pi.php o
n line 2

Other than that, the generated HTML file is fine.

I'm using the non thread-safe version of 5.3.5:

C:\PHP>php -v
PHP 5.3.5 (cli) (built: Jan  5 2011 20:36:18)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Any ideas? I'm about to kick this server through a wall. :)
0
Comment
Question by:elorc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 2000 total points
ID: 35151300
Strange, but it may be because the phpinfo function takes much parameters to display and most of them are just outputs of various functions - in this case it may be the timezone as the warning indicates. I'm not sure about IIS, but try to set the default timezone to UTC in php.ini file.
0
 
LVL 1

Author Comment

by:elorc
ID: 35151349
Huh, that fixed it. Why would a warning cause a 500 error like that? I'm trying to think of other warnings I can deliberately cause to see if they show the same behavior.
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 35151763
It is so much more for IIS than PHP - just a server's uhm... "issue" (?)
I guess I cannot force you to install Apache ;) but at least you could just give it a try as it is a slightly more user friendly to debug server errors...

Of course you can't predict anything regarding IIS, but all this should be more than just seeing 500 (or any other SERVER error code) and nothing more.
0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 6

Expert Comment

by:ramelong
ID: 35162648
Try setting for .php files the isapi file for your version instead of the cgi...
0
 
LVL 1

Author Comment

by:elorc
ID: 35201706
Ramelong: Which file should I use? Is it just php5.dll? It's been a while but I thought the file I needed to use is php5isapi.dll, which isn't included in the package I downloaded from php.net.
0
 
LVL 17

Expert Comment

by:kadadi_v
ID: 35340533
In IIS Is any application Pool Selection Problem....?

Also Can You please go-through this URL:

http://www.thewebhostinghero.com/tutorials/install-iis7-php5-mysql5-win2008server-pt2.html

Regards,
vijay kadadi



0
 
LVL 1

Author Comment

by:elorc
ID: 35369680
I think this is squared away at this point. The only thing that I really have to deal with now (that I'm aware of) is that I'm going to have to rewrite the PHP scripts I maintain so that they're compatible with the Microsoft PHP library, since the old php_mssql isn't supported anymore.

Thanks everyone.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to install and use the NTBackup utility that comes with Windows Server.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question