PHP 7 - Installation on Windows with IIS

The Windows server installation of PHP running IIS is much simpler than on Unix, since it involves a precompiled binary rather than a source build.

If you plan to install PHP over Windows, then here is the list of prerequisites −

  • A working PHP-supported Web server. Under previous versions of PHP, IIS/PWS was the easiest choice because a module version of PHP was available for it; but PHP now has added a much wider selection of modules for Windows.

  • A correctly installed PHP-supported database like MySQL or Oracle etc. (if you plan to use one)

  • The PHP Windows binary distribution (download it at

  • A utility to unzip files (search for PC file compression utilities)

Now here are the steps to install Apache and PHP5 on your Windows machine. If your PHP version is different then please take care accordingly.

  • Extract the binary archive using your unzip utility; C:\PHP is a common location.

  • Copy some .dll files from your PHP directory to your systems directory (usually C:\Winnt\System32). You need php5ts.dll for every case. You will also probably need to copy the file corresponding to your Web server module - C:\PHP\Sapi\php7isapi.dll. It is possible you will also need other files from the dlls subfolder, but start with the two files mentioned above and add more if you need them.

  • Copy either the php.ini-development or php.ini-recommended (preferably the latter) to your Windows directory (C:\Winnt or C:\Winnt40), and rename it php.ini. Open this file in a text editor (for example, Notepad). Edit this file to get the configuration directives. We highly recommend the new users to set error-reporting to E_ALL on their development machines at this point. For now, the most important thing is the doc_root directive under the Paths and Directories section. Make sure this matches the IIS Inetpub folder (or wherever you plan to serve out of).

  • Stop and restart the WWW service. Go to the Start menu → Settings → Control Panel → Services. Scroll down the list to IIS Admin Service. Select it and click Stop. After it stops, select the World Wide Web Publishing Service and click Start. Stopping and restarting the service from within the Internet Service Manager will not suffice. Since this is Windows, you may also wish to reboot.

  • Open a text editor. Type: <?php phpinfo(); ?>. Save this file in your Web server's document root as info.php.

  • Start any Web browser and browse the file. You must always use an HTTP request ( or http://localhost/info.php or rather than a filename (/home/httpd/info.php) for the file to be parsed correctly.

You will see a long table of information about your new PHP installation message Congratulations!