we have a dedicated server running IIS 7. There is a PHP site (wordpress) running from the server. We want to be able to run an asp.net app on the same server, preferably from within the php site. Any ideas on how to do this?

  • 3
    You mean Virtual Directories under the main PHP "website?" You shouldn't have any issues with this. Simply enable "ASP.NET" from within "Manage Your Server" (Add/Modify Role -> IIS -> ASP.NET [x]). – Nate Aug 2 '10 at 15:16
  • Yes, I've added a Virtual Directory to the asp.net app under the PHP website. I don't see an option under Add Roles for ASP.NET, but I'm fairly certain that's already activated. – fro Aug 2 '10 at 15:42

IIS doesn't care at all what kind of "application" you run on it, it doesn't even have any concept of "application" as we humans could mean it (*). It only sees files, and chooses what to do with them based on their extension: simply serve them to the client if they have .html, process them with the classic ASP engine if they have .asp, use the PHP interpreter if they have .php, and so on up to .aspx files, which are handled by the ASP.NET engine. Those interpreters of course have to be installed and enabled on the web server, and the relevant file extensions have to be mapped in order for IIS to know what to do with them; but once this is done, IIS will happily serve any file it can understand, regardless of its position either in the file system or in the web site structure.

So, to sum it up: yes, if the PHP and ASP.NET engines are installed and enabled on the server, you can mix .php and .aspx (and any other) files any way you want, and they can of course call each other.

(*) Yes, yes, we could talk for hours about application pools and worker processes; this just doesn't change the main point, though.

  • It's great that this is possible, but it's not working on my server. I've looked at the "Handler Mappings" for the php site and it includes mappings for .aspx files, but I'm still getting a 404 when navigating to the asp.net application. – fro Aug 2 '10 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.