Sunday, September 13, 2020

How to Install PHP on Windows with IIS



Hello dear readers! welcome back to another section of my tutorial on PHP. In this tutorial guide, we will be discussing about how to Install PHP on Windows with IIS.

The Windows server installation of PHP running IIS is much earlier than 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 -

  • Working PHP-supported Web server. Under the previous versions of PHP, IIS/PWS was the easiest choice, because a module version of PHP was available for it; but PHP has now added a much wider selection of modules for Windows.
  • Secondly 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 system. If the version of your PHP is different, then please take care accordingly.

Step 1

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

Step 2

Copy few .dll files from your PHP directory to your systems directory (usually C:\Winnt\System32). You require 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

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 so as 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 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 click Stop. After it stops select 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 a Windows OS, you may wish to reboot.

Step 5

Open 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 make use of an HTTP request. For example, (http://www.domain.com/info.php or http://localhost/info.php or http://127.0.0.1/info.php) rather than making use of a filename (/home/httpd/info.php) in order for the file to be parsed correctly.

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


Alright guys! This is where we are rounding up for this tutorial post. In my next tutorial post, we are going to be studying about PHP Installation on Windows OS using Apache.

Feel free to ask your questions where necessary and i 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.
Share:

0 comments:

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.