Sitemap

How to deploy a PHP website (or application) to IIS Windows Server

3 min readOct 6, 2023

The majority of PHP applications use the Apache or Nginx web servers, although there are good reasons to use IIS instead:

→ IIS knowledge among your system engineers is more extensive.
→ Your agreement with Microsoft for support is excellent.
→ You must use either ASP.NET or traditional ASP apps.
→ You must work on PHP solutions in addition to developing Windows-only solutions locally on IIS.
→ Other Windows services like Active Directory, Windows file sharing, or Microsoft Exchange must be integrated.

IIS can only be used on Windows, although running PHP on IIS differs from running PHP on Windows. Windows users have the option of running PHP via XAMPP or WampServer. However, these two alternatives provide you some further possibilities to consider. They employ MySQL or MariaDB as a database server and Apache as a web server.

Your needs might not be met by this. It’s a good idea to run your PHP websites under IIS if you already have websites operating there. They are all together in this manner. You could even wish to employ a different database technology. Or you prefer the reliability of a solution provided by the big company that Microsoft is. You’ll find that it isn’t all that difficult when we look at installing PHP on IIS.

  1. Install IIS through ‘Windows Features’ and make sure to select following options, and then IIS manager will be installed in your windows.
    — Dot Net Framework
    — Internet Information Services
    — CGI
Turn Windows features on or off

2. Once IIS manager Installation is completed then to verify it type localhost in your browser and press enter and it will show you IIS manager welcome screen.

3. Download and install PHP Manager and once finished then close IIS Manager and open it again then you can see PHP Manager option is available.

Internet Information Services (IIS) Manager

4. Download PHP Version

5. Extract the PHP version (Do not extract this version in “C” Drive).

6. Next select ‘Default Web Site’ from left panel and double click on PHP Manager then click on ‘Register new PHP version’ and here select ‘php-cgi.exe’ from extracted PHP version and click OK and then you can see PHP configuration details in PHP Manager.

Default Web Site → PHP Manager
Register new PHP version
PHP Manager

7. To verify this click on ‘check phpinfo()’ and click OK then PHP version details will be displayed.

phpinfo()

8. You can also place PHP file in the wwwroot location of ‘Default Web Site’ which is ‘C:\inetpub\wwwroot’ then type this URL in browser ‘http://localhost/filename.php'

index.php file

--

--

Surya Raj Ghimire
Surya Raj Ghimire

No responses yet