Hosting ASP.NET and PHP side by side on IIS

A practical guide to running PHP, ASP.NET 4.x, ASP.NET Core and Classic ASP sites on one Windows Server with IIS, and what a panel should handle for you.

Cover image: Hosting ASP.NET and PHP side by side on IIS

Key takeaways

  • Give every website its own application pool identity and file permissions; that is the base of isolation on IIS.
  • PHP runs on IIS through FastCGI; Zopanel offers PHP 8.3 and 8.4 per site from a signed catalog.
  • ASP.NET Core 10 runs in Zopanel as a Kestrel service behind IIS and ARR; in-process hosting is still experimental.
  • IIS uses web.config and URL Rewrite rules instead of .htaccess.

One Windows Server can run a WordPress blog, a legacy ASP.NET 4.8 web forms application and a new ASP.NET Core API at the same time. IIS handles all three, but each needs a different setup, and they can disturb each other if you share too much. This guide covers what to configure, and how Zopanel for Windows handles it per site.

The base: one application pool per site

On IIS, the application pool decides which identity a site's code runs as. If two sites share a pool, a bug or a compromise in one can read the other's files.

The rule is simple: one pool per site, with its own identity, and file permissions (ACLs) that only grant that identity access to its own folder. Zopanel creates the pool, the identity and the ACLs when it creates a site, and keeps the site's files in C:\inetpub\zopanel\<id>. It does not follow junctions when it applies permissions or deletes a site.

Per-site pool settings you will want to touch sometimes:

  • idle timeout and recycling schedule;
  • 32-bit mode, for old components that need it;
  • managed pipeline mode and .NET CLR version, for ASP.NET 4.x;
  • the request queue length.

In Zopanel these are on the site's settings, and plans can cap CPU (by cores) and memory per site so one busy site does not slow its neighbours.

PHP on IIS

PHP runs on IIS through FastCGI (php-cgi.exe). Things to get right:

  • Versions. Install the PHP builds you need and pick one per site. Zopanel installs PHP 8.3 and 8.4 from its signed catalog and lets each site choose. PHP 8.5 is in the catalog but we have not tested it yet. There is no PHP 7.x or 5.x.
  • Settings per site. Each site needs its own memory_limit, upload_max_filesize and similar values. Zopanel exposes a whitelist of directives and extensions per site, capped by the plan.
  • FastCGI limits. Set the number of PHP processes and request limits to match the server's size, not one value for all.
  • open_basedir. It limits which folders PHP can open. Zopanel leaves it off by default for new sites (many applications break with it) and lets the plan or the site turn it on. The pool's ACLs are the real boundary.
  • .htaccess does not work. IIS uses web.config. Rewrite rules go through the URL Rewrite module; WordPress permalinks need a rewrite rule, which Zopanel adds when it installs WordPress.

A known effect: idle PHP processes are recycled after about 6 to 7.5 minutes, so the first request after a quiet period is slower. If that matters, turn on Always ready in the site's speed settings.

A common error is 404.3 on every .php file: the site has no PHP handler, usually because setting the PHP version failed while the server was busy. Pick the version again and check the task list. See PHP on Zopanel.

ASP.NET 4.x and Classic ASP

ASP.NET Framework 4.x runs in-process in IIS, in the site's pool with the .NET CLR v4. Classic ASP is an IIS feature you turn on per site. Both are available in Zopanel on Server 2019, 2022 and 2025.

Per-site ASP.NET settings worth knowing:

  • customErrors: show details only while you debug, never on a live site;
  • session state mode and timeout;
  • machineKey, which must stay stable if you run several servers or need cookies to survive a recycle;
  • debug compilation, which should be off in production.

On Server 2019, target .NET Framework 4.7.2 in your applications.

A known limit: when another site is writing the server's root web.config, the first ASP.NET request can fail. Reload and it passes; if it repeats, send it to support.

ASP.NET 3.5 (CLR v2) is not available.

ASP.NET Core

ASP.NET Core can run in two ways on Windows:

  1. Out of process: the application runs as its own Kestrel process, and IIS forwards requests to it.
  2. In process: the ASP.NET Core Module (ANCM) loads the application into the IIS worker process.

Zopanel runs ASP.NET Core 10 as a Kestrel service behind IIS and ARR, both framework-dependent and self-contained builds. Each app runs in a Windows Job Object with memory and CPU limits, restarts with backoff if it crashes, and stops with its whole process tree. Deploys are immutable releases with a health check and rollback. In-process hosting through the Hosting Bundle is experimental: it is in the catalog but we have not run an application with it on Windows yet.

Environment variables and secrets are set per site and are write-only in the panel. See ASP.NET on Zopanel.

Node.js, Python, Java and Go beside them

The same reverse-proxy pattern covers other runtimes: Node.js 22 and 24 side by side, Python with waitress or uvicorn, both behind ARR. Java (Temurin JRE) and Go run as services too; we have tested them on Server 2022. All use the same Job Object limits.

Publishing from Visual Studio: Web Deploy

Many .NET teams publish with Web Deploy. It needs the Web Management Service on port 8172 and an IIS Manager user per site. Zopanel can install Web Deploy, create that per-site user, open port 8172 and give you a .publishsettings file to import into Visual Studio. This is marked limited: it works on our 2019 and 2025 servers and on a fresh 2022 server after a fix, with the details in the release notes.

If you prefer, deploy from a zip or from GitHub/GitLab through the panel instead.

HTTPS and redirects

Every site, whatever its language, gets a Let's Encrypt certificate over HTTP-01 with automatic renewal, SNI bindings, and a Force HTTPS switch. Redirects, hotlink protection, custom error pages, MIME types and virtual directories are per-site IIS settings in the panel. Wildcard certificates through DNS-01 are not available yet.

A checklist

  • One pool and one identity per site; ACLs only for that identity.
  • PHP version and directives per site; FastCGI limits sized to the server.
  • web.config and URL Rewrite instead of .htaccess.
  • ASP.NET: customErrors on, debug off, a fixed machineKey when it matters.
  • ASP.NET Core behind IIS/ARR, with memory and CPU limits.
  • CPU and memory limits per site in the plan.
  • HTTPS forced, certificates renewing by themselves.

Zopanel for Windows does all of this from one panel on Windows Server 2019, 2022 and 2025. Try it on the Free plan (1 server, 10 websites): start with the install guide, then read Websites and IIS.