PHP and .NET on the Same Server?

I wasn’t sure whether to post this on the PHP forum or ASP.NET, but here goes…

I work at a company that runs nothing but IIS on their servers. All of the administrators are hardcore MicroSoft guys. I have nothing against .NET, but I would like to use PHP and MySql for some future projects and I approached our admins about setting up the servers to use PHP alongside .NET.

They wouldn’t have any part of it. In fact, they told me that it is impossible to run both on the same server.

This sounds like a load of crap to me. I have no intention of creating sites that mix PHP and ASP - I just want to be able to create either one or the other on the same server.

My question is, why can’t I run Apache and IIS on the same server? Are these guys right?

You can run Apache and IIS on the same server, but you cannot bind them both to port 80.

If all of your colleagues are using .NET, then you should probably use .NET as well. You might not always work there, so your applications will have to be maintainable by any future employees.

Of course PHP can be run under .NET just as it can run on other gateways such as CGI. Perhaps you can get them to install PHP as another of the languages that they allow on their .NET gateway.

You cannot run Apache and IIS on the same port (80) you must pick a different one for them to run at the same time. What version of IIS are you running? 5.1, 6, or 7? If either of those you can run PHP using IIS with FastCGI. In my signature I have a link filed with IIS resources, you may also want to look at PHP Windows.

On a side note, I’m glad PHP is starting to move away from VC6 (LEGACY OLD!) and starting to use the newer VC9 (Visual Studio 2008) compiler! However cannot use VC9 compiled binaries with Apache.

As logic_earth intimates, should your question not be “how do I run .Net and PHP on the same IIS server?”

Is there a need to use Apache at all?

Hey, thanks for the info everyone!

Cups and Felgal: yes, if I can run PHP without problems on IIS, than that would be ideal.

When I think PHP, I automatically think Apache as well. If there are no known issues to running it on IIS, than I will see if I can get them to allow PHP on the .NET gateway.

No worries, I’ve been a PHP coder since 99 and only at the end of last year did I use apache (on a dev machine).

I silently switched an IIS server from old-fashioned .asp to .php, and even managed to get the same server to send a script to both parses in turn.

One thing you will miss is mod_rewrite, but I found a very nice (paid for) look alike which worked very nicely.

I’d go into your next meeting pre-armed and make sure you know how to configure IIS to pick up the correct .dll files. Good luck with it.