Re: IIS, ASP & PHP - is it possible?

From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 09/26/04


Date: Sun, 26 Sep 2004 01:40:41 -0700

Yes, IIS is perfectly able to run both ASP and PHP on the same server at the
same time.

In fact, IIS can run just about everything at the same time, assuming those
programs are written to work with each other. For example, it is very
possible to run HTML, ASP, ASP.Net, PHP, Perl at the same time because those
technologies are very well behaved and do not affect one another. Things
are a little more challenging when you try to run Cold Fusion, Websphere,
Tomcat, and JSP since those technologies take over the server a bit more and
can cause conflicts.

Here is a conceptual description of how IIS handles requests.

After parsing the request and determining the actual URL that is to be
executed, IIS determines whether it is static or dynamic and executes it
appropriately.

A static request is one that doesn't need any processing on the server (i.e.
it's static and non-changing) prior to sending to the browser -- like a HTML
page, GIF/JPG image, etc

A dynamic request is one that needs some processing on the server to send
out a response to the server, and IIS distinguishes between those that are
scriptmapped (i.e. the URL points to a resource that needs to be interpreted
by a script engine, such as ASP, ASP.Net, PHP, Perl , before a response can
be sent out) and standard ISAPI/CGI which are directly executable by IIS to
generate a response.

Thus, an ASP page is simply a resource on the server containing script
commands. IIS has a line of configuration which maps all requests to .asp
extension to the ASP script engine. When you make a request to a .ASP URL,
IIS looks up the configuration, sees that it is scriptmapped to an ASP
script engine, and hands the URL to the ASP script engine, which then opens
the ASP file, reads and executes its contents, and sends the response out.

PHP works in much the same way. Once you install the PHP files on the
server, you will have to add a line of configuration to IIS which maps all
request to .php extension to the PHP script engine -- so that all .PHP URLs
get handled by the PHP script engine, which will open the PHP file, read and
execute its contents, and send out a response.

PHP happens to have two forms of extensibility for IIS -- an ISAPI version
and a CGI version. Either will work, though I tend to recommend the ISAPI
version if it is stable for you -- because it is a format more native to IIS
and will likely be the wave of the future.

-- 
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Matthew Brookes" <mattyb@matthewbrookes.(spam)com> wrote in message
news:Ilu5d.4797$5O5.2796@news-server.bigpond.net.au...
Hi, I'm a small business web developer, and I don't know much about servers.
I generally develop in ASP, and am looking at doing some work in PHP too.
I run IIS 5.0 and Win 2000 Pro on my machine. I want to know if it's
possible to run ASP scripts and PHP scripts on the same machine?
Does the server just distinguish between them based on the file extension?
I've seen all the info on www.php.net regarding PHP on IIS, but I'm worried
that I'll if I install it I won't be able to run my ASP scripts.
Thanks,
Matt.
------------------------------------------------------------------------
  "Any intelligent fool can make things bigger, more complex,
   and more violent. It takes a touch of genius -- and a lot of
   courage -- to move in the opposite direction."
                                                          - Albert Einstein
------------------------------------------------------------------------


Relevant Pages

  • Re: Apache vs IIS
    ... Windows Server not on my Linux Server so there for I would chose IIS. ... Not that Apache is bad but ASP.NET is far easier and faster to create good web forms in. ... PHP on a IIS server is rather easy to run once you install PHP on a PC but if you only use PHP why not use Apache for Windows. ...
    (alt.php)
  • Re: What is the difference between php & asp?
    ... >ASP is a Microsoft product based on the very ackward Visual Basic syntax ... >PHP is a C-Like, ... >need to physically register on the server. ... It works fine with SQL Server and Access if you really really ...
    (alt.php)
  • Re: Apache vs IIS
    ... my Windows Server not on my Linux Server so there for I would ... IIS is designed for ASP, ... can run asp on Apache, ... in running php from IIS vs Apache. ...
    (alt.php)
  • RE: asp pages error
    ... our intranet connects to several access databases we dont get an asp ... I tried to add a new site to iis, ... > down and type the full content of the error message to the Newsgroup. ... > SP1 on your SBS 2K3 server? ...
    (microsoft.public.windows.server.sbs)
  • Re: Problem with freezing on IIS
    ... Low protection means the web app is running inside inetInfo.exe itself ... something wrong with COM+ or IIS is having some kind of logon problem. ... When we had it set to Medium, it would not even process ASP pages. ... settings (as is the problem server). ...
    (microsoft.public.inetserver.iis)