Connect with us

How To Install PHP On IIS In Windows 10 Step-By-Step | Install IIS On Windows 10

Install PHP On IIS In Windows 10

Computer Science

How To Install PHP On IIS In Windows 10 Step-By-Step | Install IIS On Windows 10

IIS (Internet Information Server) is one of the most powerful web servers from Microsoft that is used to host your Web applications.

Generally IIS is well known for running ASP.NET web applications in Windows and other web servers like WAMP, XAMP etc, are known for running PHP scripts.

Microsoft has developed IIS so flexible that you can run PHP scripts on it as well.

In this tutorial we will guide you step-by-step to How to install IIS on Windows 10 & then How to install PHP on IIS.

 

Step 1: Install IIS On Windows 10

  • Click Windows 10 Search Bar.
  • Type Control Panel.
  • Click Control Panel.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 1
  • Click Programs and Features.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 2
  • Click Turn Windows features on or off.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 3
  • Click Internet Information Services
  • Click World Wide Web Services
  • Click Application Development Features
  • Tick CGI
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 4
  • Wait for the changes to be applied.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 5

 

Step 2: Download PHP

How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 6
  • Extract Zip folder to C:.
  • Name it PHP.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 7

 

Step 3: Configure PHP.ini

  • Open PHP folder.
  • Copy php.ini-production file & Paste there in the same directory.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 8
  • Rename the copied file as php.ini.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 9
  • Right click on the php.ini file(php). Note that the extension .ini will  not be visible.
  • Open with Notepad.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 11
  • -Press Ctrl + F5 to open search box.
  • Use Up & Down radio buttons, because some of the lines are at top and some are at middle and some are at bottom.
  • “;” is a comment symbol. It means such lines will not be executed.
  • Find the lines below in your php.ini, remove the “;” symbol from their start and make the changes, which I have made.
  • Save these changes as well.

 

Find — extension_dir = “./” —  Replace with —  extension_dir = “C:PHPext”
Find — fastcgi.impersonate=0 — Replace with —  fastcgi.impersonate=1
Find — cgi.fix_pathinfo=0 — Replace with —  cgi.fix_pathinfo=0
Find — cgi.force_redirect=1 Replace with — cgi.force_redirect=0
Find — error_log = php_errors.log (remove “;“)

Find these lines below and remove only  (“;“) from their start.

extension=curl
extension=gd2
extension=mbstring
extension=mysqli
extension=pdo_mysql

extension=xmlrpc

How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 12
  • Press Ctrl + S to save the changes.

 

Step 4: Configure The Environment Variables

  • Click Control Panel
  • Click System and Security
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 13
  • Click System
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 14
  • Click Advanced system settings
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 15
  • Click Environmental Variables
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 16
  • Select Path & click Edit under the System variables Label.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 17
  • Click New.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 18
  • Type C:PHP
  • Click OK
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 19

 

Step 5: Configure IIS

  • Type IIS on Windows Search Bar or Type Run.
  • Click Run.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 20
  • Type inetmgr
  • Click OK
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 21
  • Click Handler Mappings.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 22
  • Click Add Module Mapping
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 23
  • On request path: type *.php
  • On Module, select FastCgiModule from dropdown menu
  • On Executable, browse: C:PHPphp-cgi.exe
  • Name it anything, type FastCGI
  • Click OK.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 24

 

Step 6: Test The PHP Version

  • On Windows Search Bar Type CMD
  • Right click on it and select as Run as administrator
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 25
  • Type php -version.
  • Here it is showing me VCRUNTIME140.dll error because in my computer, The Visual C++ Redistributable. Packages is not installed.
  • Check the C: drive whether the setup vc_redist.x64.exe is present or not.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 26
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 27
  • Tick vc_redist.x64.exe
  • Click Next to begin downloading
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 28
  • Click the setup to install.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 29
  • Now type again, php -version on command prompt.
  • You can see that it is not showing the error.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 30

 

Step 7: Test A PHP File

  • Click Windows Search Bar
  • Type Notepad
  • Right Click on Notepad
  • Click Run as administrator
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 31
  • Type this HTML code or write your own code in PHP or HTML.
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 32
  • Save As this file in: C:inetpubwwwroot as test.php
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 33
  • Click this or type this on your browser’s URL bar
  • http://localhost/test.php
  • You can see that I have successfully configured PHP on IIS in Windows 10
How To Install PHP On IIS In Windows 10 Step-By-Step? | Install IIS On Windows 10 35
  • That’s it. You’re done. If you like this post, don’t forget to share this post with other people. Share your feedback in the comments section below.

 

Best Web hosting with discount

 

Recommended Posts

 

Meer Basit is the founder of Meer’s World. He’s been running the show since launching the blog back in 2018. By background he is a computer scientist. Primarily, he creates content around blogging (WordPress, Blogger, Tumblr), SEO, affiliate programs, earn-online, reviews, eCommerce, & technology. He has got years of professional experience in web programming, computer programming, databases, data warehousing, claim handling, & transcription. In general, he likes traveling, gardening, watching movies, is a passionate cricketer, creative writer, and a GSD lover.

27 Comments

27 Comments

  1. Pedro Lucas

    December 13, 2019 at 11:33 am

    Thank you so much for such a magnificent tutorial. I was struggling to install IIS on Windows 10 for PHP, but now I have done it.

  2. Unknown

    January 19, 2020 at 4:57 am

    Thank You so much. It works briliantly!!

  3. Unknown

    March 20, 2020 at 4:08 pm

    Awesome tutorial. How anyone would do this without this info.

  4. AALBC.com

    July 2, 2020 at 1:53 pm

    Perfect instructions other sites left out important steps — thanks!

  5. Unknown

    July 28, 2020 at 5:06 pm

    Thank you SO MUCH! Hooked me UP!
    Was sweating the prospect of getting PHP running on a new, extremely powerful laptop.
    This tutorial was spot-on.
    Thanks for posting it!
    Stay safe out there.

    • Meer Basit

      July 29, 2020 at 2:39 am

      So nice of you! I appreciate your kind words! Thanks.

  6. Anonymous

    August 24, 2020 at 6:36 am

    Great guide. It is accurate. Thank you a lot

  7. Unknown

    October 15, 2020 at 10:54 am

    Great guide, I was facing this issue since two days and there was no solution. Thanks you very much.

  8. Unknown

    October 18, 2020 at 1:47 pm

    I am facing an issue (as below) during the installation of "Composer" application. Can you help me?

    "
    The Composer installer script was not successful [exit code 1].

    Script Output:
    The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. "

  9. Unknown

    October 21, 2020 at 6:43 am

    Thanks brother, its was done just I connect through my personal hotspot, my official network (WIFI) was not allowing.

    I am actual new self learner and I am facing much difficulties, like now I stuck to render Twig elements in PHP on IIS server. Since yesterday I am trying but its not showing any result.

    Sorry I am bothering you again and again. If can help me in this Twig issue, I will be very thankful to you.

    BR, Muhammad Azhar Farooq

  10. Unknown

    October 22, 2020 at 12:09 pm

    Many thanks, now at least some simple Twig templates showing contents but with some functions, conditions and loops are not rendered properly, just showing blank white page.

    Thanks again.

  11. Anonymous

    December 8, 2020 at 5:39 pm

    Thanks a lot. This is what any step by step should be

  12. Unknown

    January 4, 2021 at 11:34 am

    Thank you so much with the help of your instructions I'm successfully install IIS on windows 10.

  13. Unknown

    May 30, 2021 at 5:08 am

    Very useful post. I wasted a lot of time on http error 404.3 while trying to use wordpress for the first time before I came across this post. Solved the problem. Thank you

Leave a Reply

Your email address will not be published.

More in Computer Science

To Top