We now have a youtube channel. Subscribe!

How to Install PHP on Windows with IIS

How to install PHP on Windows with IIS


Hello folks! Welcome back to a new section of our tutorial on PHP. In this tutorial guide, we'll be studying about how to Install PHP on Windows with IIS.

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

If you plan installing PHP on your Windows OS, then here is the list of prerequisites -

  • A working PHP-supported Web server. Under older versions of PHP, IIS/PWS was the simplest choice, because a module version of PHP was available for it; but PHP has now added a much wider range of modules selection for Windows.
  • Next is a well installed PHP-supported database, for example MySQL, Oracle etc. (if you plan to use one)
  • A utility to unzip files.


Steps to Install PHP on Windows with IIS

The following below are the simple steps to install Apache and PHP5 on your Windows operating system(os). If your PHP version is different, then please take care accordingly.

Step 1

First you need to extract the binary archive making use of your unzip utility; C:\PHP is a common location.

Step 2

Now copy some .dll files from your PHP directory to your systems directory (usually C:\Winnt\System32). You're going to need a php5ts.dll for every case. You also may need to copy the file matching to your server module - C:\PHP\Sapi\php5isapi.dll. Its very possible you will also need others from the dlls subfolder - but start with the two mentioned above and then you can add more if you need them.

Step 3

Now go ahead to copy either php.ini-dist or php.ini-recommended (preferably the latter) to your Windows directory (C:\Winnt or C:\Winnt40), and then rename it to php.ini. Open this file in a text editor (Notepad). Edit this file in order to get the configuration directives; We highly recommend new users to set error reporting to E_ALL on their PHP 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 your IIS Inetpub folder(or whatever you plan to serve out of).

Step 4

Stop and restart the WWW service. Now go to Start menu → Settings → Control → Panel → Services. Scroll down the list to IIS Admin Service. Select it and then click Stop. After it stops, go on and select World Wide Web (WWW) publishing Service and click Start. Stopping and restarting the service from within the Internet Service Manager will not suffice. Since this is a Windows OS, you may wish to reboot.

Step 5

Open up a text editor and then type: <?php phpinfo(); ?>. Then save this file in your Web server's document root as info.php.

Step 6

Open any browser and browse the file. You must always utilize an HTTP request. For example, (http://www.domain.com/info.php or http://localhost/info.php) instead of using a filename (/home/httpd/info.php) in order for the file to be parsed correctly.

You should see a long table of information about your new PHP Installation message.


Alright guys! This is where we are rounding up for this tutorial post. In our next tutorial guide, we are going to be discussing about PHP Installation on the Windows Operating System using Apache.

Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.

Thanks for reading and bye for now.

Post a Comment

Hello dear readers! Please kindly try your best to make sure your comments comply with our comment policy guidelines. You can visit our comment policy page to view these guidelines which are clearly stated. Thank you.
© 2023 ‧ WebDesignTutorialz. All rights reserved. Developed by Jago Desain