PHP Doesn"t Work on IIS7
am 08.08.2007 23:46:52 von David Sudlow
Hi guys,
I installed IIS on Vista Ultimate and created a virtual directory to test it
out; everything seems fine.
I then tried installing PHP and it doesn't work, I read many guides and
still have no luck.
Here is what I did:
copied php.ini-recommended to the 'Windows' folder
set cgi.force_redirect=0
renamed the file to php.ini
copied php-cgi.exe to 'Windows/System32'
In the IIS Manager I clicked my virtual site then clicked Handler Mappings
Then selected Add Script Map...
Filled it out:
Request Path: *.php
Executable: (the path to php-cgi.exe)
Name: PHP
When I try my test.php page I get a HTTP 500 error (after about five seconds
of it trying to connect).
Please help. Thank you.
Re: PHP Doesn"t Work on IIS7
am 09.08.2007 06:33:25 von David Wang
On Aug 8, 2:46 pm, "Robert A." wrote:
> Hi guys,
>
> I installed IIS on Vista Ultimate and created a virtual directory to test it
> out; everything seems fine.
>
> I then tried installing PHP and it doesn't work, I read many guides and
> still have no luck.
>
> Here is what I did:
>
> copied php.ini-recommended to the 'Windows' folder
> set cgi.force_redirect=0
> renamed the file to php.ini
>
> copied php-cgi.exe to 'Windows/System32'
>
> In the IIS Manager I clicked my virtual site then clicked Handler Mappings
> Then selected Add Script Map...
> Filled it out:
> Request Path: *.php
> Executable: (the path to php-cgi.exe)
> Name: PHP
>
> When I try my test.php page I get a HTTP 500 error (after about five seconds
> of it trying to connect).
>
> Please help. Thank you.
Good versions of PHP will support versioning so they can install
anywhere. I wouldn't move the files into Windows or Windows\System32
folders -- that's just insecure and broken.
IIS7 does not install with CGI support by default, so what you did
will not work.
Since it is a CGI, you also need to enable it in Web Service
Extensions or else it will not work.
Also, report the actual log entry in the web logs. Just saying you get
HTTP 500 error is insufficient evidence.
Finally, for all errors, you can turn on Failed Request Tracing (also
an optional IIS7 component) to troubleshoot exactly what happened.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
Re: PHP Doesn"t Work on IIS7
am 09.08.2007 12:26:40 von Steve Schofield
All I've ever done to get PHP to work on IIS7 is copy the php folder from
another machine, create a handler mapping to the FastCGI Module and make
sure the correct folder security is setup. I've done this procedure with
PHP version 5.2.x
--
Best regards,
Steve Schofield
Windows Server MVP - IIS
http://weblogs.asp.net/steveschofield
"Robert A." wrote in message
news:u0OMlWg2HHA.5740@TK2MSFTNGP04.phx.gbl...
> Hi guys,
>
> I installed IIS on Vista Ultimate and created a virtual directory to test
> it out; everything seems fine.
>
> I then tried installing PHP and it doesn't work, I read many guides and
> still have no luck.
>
> Here is what I did:
>
> copied php.ini-recommended to the 'Windows' folder
> set cgi.force_redirect=0
> renamed the file to php.ini
>
> copied php-cgi.exe to 'Windows/System32'
>
> In the IIS Manager I clicked my virtual site then clicked Handler Mappings
> Then selected Add Script Map...
> Filled it out:
> Request Path: *.php
> Executable: (the path to php-cgi.exe)
> Name: PHP
>
> When I try my test.php page I get a HTTP 500 error (after about five
> seconds of it trying to connect).
>
> Please help. Thank you.
>
Re: PHP Doesn"t Work on IIS7
am 09.08.2007 13:04:40 von David Wang
Yup, that's about all that's necessary, and not much different using
plain CGI or ISAPI versions of PHP, either.
It's IIS7. So you have to have a module to support loading PHP, either
the ISAPI Module, CGI Module, or FastCGI Module. Then you have to have
a handler definition telling IIS to route requests of .php extension
to the module to load PHP, and finally, PHP configuration and Folder
security for access to the resources.
Oh yeah, CGI and ISAPI have Web Service Extension from a legacy
perspective, but IIS7 modules are enabled/disabled via the
list.
It's all pretty much the same no matter which way you go.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
On Aug 9, 3:26 am, "Steve Schofield" wrote:
> All I've ever done to get PHP to work on IIS7 is copy the php folder from
> another machine, create a handler mapping to the FastCGI Module and make
> sure the correct folder security is setup. I've done this procedure with
> PHP version 5.2.x
>
> --
>
> Best regards,
>
> Steve Schofield
> Windows Server MVP - IIShttp://weblogs.asp.net/steveschofield
>
> "Robert A." wrote in message
>
> news:u0OMlWg2HHA.5740@TK2MSFTNGP04.phx.gbl...
>
>
>
> > Hi guys,
>
> > I installed IIS on Vista Ultimate and created a virtual directory to test
> > it out; everything seems fine.
>
> > I then tried installing PHP and it doesn't work, I read many guides and
> > still have no luck.
>
> > Here is what I did:
>
> > copied php.ini-recommended to the 'Windows' folder
> > set cgi.force_redirect=0
> > renamed the file to php.ini
>
> > copied php-cgi.exe to 'Windows/System32'
>
> > In the IIS Manager I clicked my virtual site then clicked Handler Mappings
> > Then selected Add Script Map...
> > Filled it out:
> > Request Path: *.php
> > Executable: (the path to php-cgi.exe)
> > Name: PHP
>
> > When I try my test.php page I get a HTTP 500 error (after about five
> > seconds of it trying to connect).
>
> > Please help. Thank you.- Hide quoted text -
>
> - Show quoted text -
Re: PHP Doesn"t Work on IIS7
am 09.08.2007 19:22:39 von David Sudlow
Hi,
Yeah, I don't know why I'm having problems. I used to set it up on XP (IIS6)
in two minutes.
When I setup the handler mapping should I use the topmost node (my computer
name), the default web sites node, or do it for each virtual site I make ?
The virtual sites don't seem to inherit the handler.
Also, do I have to do anything outside of the management console with
respect to security settings ? If so, what ? Maybe that's the problem.
I'm going to try again and let you know how I make out.
I appreciate the help.
Thanks guys.
"Steve Schofield" wrote in message
news:OgXYH$m2HHA.6072@TK2MSFTNGP03.phx.gbl...
> All I've ever done to get PHP to work on IIS7 is copy the php folder from
> another machine, create a handler mapping to the FastCGI Module and make
> sure the correct folder security is setup. I've done this procedure with
> PHP version 5.2.x
>
> --
>
> Best regards,
>
> Steve Schofield
> Windows Server MVP - IIS
> http://weblogs.asp.net/steveschofield
>
> "Robert A." wrote in message
> news:u0OMlWg2HHA.5740@TK2MSFTNGP04.phx.gbl...
>> Hi guys,
>>
>> I installed IIS on Vista Ultimate and created a virtual directory to test
>> it out; everything seems fine.
>>
>> I then tried installing PHP and it doesn't work, I read many guides and
>> still have no luck.
>>
>> Here is what I did:
>>
>> copied php.ini-recommended to the 'Windows' folder
>> set cgi.force_redirect=0
>> renamed the file to php.ini
>>
>> copied php-cgi.exe to 'Windows/System32'
>>
>> In the IIS Manager I clicked my virtual site then clicked Handler
>> Mappings
>> Then selected Add Script Map...
>> Filled it out:
>> Request Path: *.php
>> Executable: (the path to php-cgi.exe)
>> Name: PHP
>>
>> When I try my test.php page I get a HTTP 500 error (after about five
>> seconds of it trying to connect).
>>
>> Please help. Thank you.
>>
>
Re: PHP Doesn"t Work on IIS7
am 09.08.2007 21:43:07 von David Wang
IIS 5.1 is on XP Pro 32bit
IIS6 is on XP Pro 64bit and all versions of Windows Server 2003.
IIS7 is on Vista
You can set up handler mapping globally as "defaults" and have them
inherit. That is the way the IIS configuration works. If they do not
appear to inherit, then you likely have made local customizations that
prevent inheritance. Change the local, per-website configuration to re-
inherit - I believe this is possible in the UI now.
All the necessary IIS settings that you have to make can be made
within the IIS Management UI. Other settings are made with their
respective UIs.
If you still need to troubleshoot, you need to start using Failed
Request tracing feature within IIS7 (it's not installed by default) to
gather a trace of what is causing the 500. It is pretty comprehensive
and detailed, but it gives the clearest picture of what exactly is
going awry on your setup.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
On Aug 9, 10:22 am, "Robert A." wrote:
> Hi,
>
> Yeah, I don't know why I'm having problems. I used to set it up on XP (IIS6)
> in two minutes.
>
> When I setup the handler mapping should I use the topmost node (my computer
> name), the default web sites node, or do it for each virtual site I make ?
> The virtual sites don't seem to inherit the handler.
>
> Also, do I have to do anything outside of the management console with
> respect to security settings ? If so, what ? Maybe that's the problem.
>
> I'm going to try again and let you know how I make out.
>
> I appreciate the help.
>
> Thanks guys.
>
> "Steve Schofield" wrote in message
>
> news:OgXYH$m2HHA.6072@TK2MSFTNGP03.phx.gbl...
>
>
>
> > All I've ever done to get PHP to work on IIS7 is copy the php folder from
> > another machine, create a handler mapping to the FastCGI Module and make
> > sure the correct folder security is setup. I've done this procedure with
> > PHP version 5.2.x
>
> > --
>
> > Best regards,
>
> > Steve Schofield
> > Windows Server MVP - IIS
> >http://weblogs.asp.net/steveschofield
>
> > "Robert A." wrote in message
> >news:u0OMlWg2HHA.5740@TK2MSFTNGP04.phx.gbl...
> >> Hi guys,
>
> >> I installed IIS on Vista Ultimate and created a virtual directory to test
> >> it out; everything seems fine.
>
> >> I then tried installing PHP and it doesn't work, I read many guides and
> >> still have no luck.
>
> >> Here is what I did:
>
> >> copied php.ini-recommended to the 'Windows' folder
> >> set cgi.force_redirect=0
> >> renamed the file to php.ini
>
> >> copied php-cgi.exe to 'Windows/System32'
>
> >> In the IIS Manager I clicked my virtual site then clicked Handler
> >> Mappings
> >> Then selected Add Script Map...
> >> Filled it out:
> >> Request Path: *.php
> >> Executable: (the path to php-cgi.exe)
> >> Name: PHP
>
> >> When I try my test.php page I get a HTTP 500 error (after about five
> >> seconds of it trying to connect).
>
> >> Please help. Thank you.- Hide quoted text -
>
> - Show quoted text -
Re: PHP Doesn"t Work on IIS7
am 09.08.2007 21:57:01 von David Sudlow
Hi David,
I got it to work.
All I did was uninstall it (using Programs and Features), then re-install
it, this time using CGI and ISAPI Extensions. Then I set up the mapping and
it worked perfectly.
I don't know what I did wrong before but this time it took me less than five
minutes to get going.
Thanks for the help.
R.
"David Wang" wrote in message
news:1186688587.675065.284120@x35g2000prf.googlegroups.com.. .
> IIS 5.1 is on XP Pro 32bit
> IIS6 is on XP Pro 64bit and all versions of Windows Server 2003.
> IIS7 is on Vista
>
> You can set up handler mapping globally as "defaults" and have them
> inherit. That is the way the IIS configuration works. If they do not
> appear to inherit, then you likely have made local customizations that
> prevent inheritance. Change the local, per-website configuration to re-
> inherit - I believe this is possible in the UI now.
>
> All the necessary IIS settings that you have to make can be made
> within the IIS Management UI. Other settings are made with their
> respective UIs.
>
> If you still need to troubleshoot, you need to start using Failed
> Request tracing feature within IIS7 (it's not installed by default) to
> gather a trace of what is causing the 500. It is pretty comprehensive
> and detailed, but it gives the clearest picture of what exactly is
> going awry on your setup.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
>
>
> On Aug 9, 10:22 am, "Robert A." wrote:
>> Hi,
>>
>> Yeah, I don't know why I'm having problems. I used to set it up on XP
>> (IIS6)
>> in two minutes.
>>
>> When I setup the handler mapping should I use the topmost node (my
>> computer
>> name), the default web sites node, or do it for each virtual site I make
>> ?
>> The virtual sites don't seem to inherit the handler.
>>
>> Also, do I have to do anything outside of the management console with
>> respect to security settings ? If so, what ? Maybe that's the problem.
>>
>> I'm going to try again and let you know how I make out.
>>
>> I appreciate the help.
>>
>> Thanks guys.
>>
>> "Steve Schofield" wrote in message
>>
>> news:OgXYH$m2HHA.6072@TK2MSFTNGP03.phx.gbl...
>>
>>
>>
>> > All I've ever done to get PHP to work on IIS7 is copy the php folder
>> > from
>> > another machine, create a handler mapping to the FastCGI Module and
>> > make
>> > sure the correct folder security is setup. I've done this procedure
>> > with
>> > PHP version 5.2.x
>>
>> > --
>>
>> > Best regards,
>>
>> > Steve Schofield
>> > Windows Server MVP - IIS
>> >http://weblogs.asp.net/steveschofield
>>
>> > "Robert A." wrote in message
>> >news:u0OMlWg2HHA.5740@TK2MSFTNGP04.phx.gbl...
>> >> Hi guys,
>>
>> >> I installed IIS on Vista Ultimate and created a virtual directory to
>> >> test
>> >> it out; everything seems fine.
>>
>> >> I then tried installing PHP and it doesn't work, I read many guides
>> >> and
>> >> still have no luck.
>>
>> >> Here is what I did:
>>
>> >> copied php.ini-recommended to the 'Windows' folder
>> >> set cgi.force_redirect=0
>> >> renamed the file to php.ini
>>
>> >> copied php-cgi.exe to 'Windows/System32'
>>
>> >> In the IIS Manager I clicked my virtual site then clicked Handler
>> >> Mappings
>> >> Then selected Add Script Map...
>> >> Filled it out:
>> >> Request Path: *.php
>> >> Executable: (the path to php-cgi.exe)
>> >> Name: PHP
>>
>> >> When I try my test.php page I get a HTTP 500 error (after about five
>> >> seconds of it trying to connect).
>>
>> >> Please help. Thank you.- Hide quoted text -
>>
>> - Show quoted text -
>
>