Computersnyou

how to configure IIS to serve PHP | PHP on IIS 8 [ tutorial ]

Posted on  9/8/2012

In this tutorial i will show you how to install PHP and configure IIS to server PHP webpages
PHP is a widely used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML

this guide is for IIS 8,  tested on windows 8 pro X64 bit 

Installation Steps 
before installation make sure you have enabled CGI module during a installation 
see installation part 


1 :  download php for windows
 
<div style="text-align: center;">
</div>

<p>
  <b>2 :</b> extract downloaded zip ( C:php )<br /> <b>3: </b>download php manager for IIS ( its an extension  for managing PHP from IIS control panel )
</p>

<div style="text-align: center;">
   <a class="btn btn-success icon-download" href="http://phpmanager.codeplex.com/releases/view/69115" target="_blank"> Download </a>
</div>

<div style="text-align: left;">
  Features of PHP manger
</div>

<ul style="text-align: left;">
  <li style="text-align: left;">
    Register PHP with IIS
  </li>
  <li style="text-align: left;">
    Validate and properly configure existing PHP installations
  </li>
  <li style="text-align: left;">
    Run multiple PHP versions side by side on the same server and even within the same web site
  </li>
  <li style="text-align: left;">
    Check PHP runtime configuration and environment (output of phpinfo() function)
  </li>
  <li style="text-align: left;">
    Configure various PHP settings
  </li>
  <li style="text-align: left;">
    Enable or disable PHP extensions
  </li>
  <li style="text-align: left;">
    Remotely manage PHP configuration in php.ini file.
  </li>
</ul>

<div style="text-align: left;">
  Easily install, configure, manage and troubleshoot one or many PHP versions on the same IIS server.
</div>

<p>
  <b>4:</b> open <i><b><span style="text-decoration: underline;">php manager</span></b></i> and click on <b><i><span style="text-decoration: underline;">register new php installation</span></i></b>
</p>

<div class="separator" style="clear: both; text-align: center;">
</div>

<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0">
  <tr>
    <td style="text-align: center;">
      <a style="margin-left: auto; margin-right: auto;" href="http://1.bp.blogspot.com/-z2FN-KqH6-4/UEuMMVgAMII/AAAAAAAAGwQ/L5eIKX5rT0U/s1600/php1.png"><img title="php installation iis" alt="php installation iis" src="http://1.bp.blogspot.com/-z2FN-KqH6-4/UEuMMVgAMII/AAAAAAAAGwQ/L5eIKX5rT0U/s640/php1.png" width="640" height="342" border="0" /></a>
    </td>
  </tr>
  
  <tr>
    <td class="tr-caption" style="text-align: center;">
      Register New PHP installation
    </td>
  </tr>
</table>

<p>
  <b>5 :</b> choose<b> </b><i style="font-weight: bold;"><span style="text-decoration: underline;">php-cgi.exe</span></i> and click<i style="font-weight: bold;"><span style="text-decoration: underline;"> ok</span></i><a style="margin-left: 1em; margin-right: 1em; text-align: center;" href="http://2.bp.blogspot.com/-jO2KGCGMx94/UEuMfN-DCDI/AAAAAAAAGwY/wCTuGY6iYu0/s1600/php2.png"><img title="php installation iis" alt="php installation iis" src="http://2.bp.blogspot.com/-jO2KGCGMx94/UEuMfN-DCDI/AAAAAAAAGwY/wCTuGY6iYu0/s640/php2.png" width="640" height="344" border="0" /></a>
</p>

<p>
  <b>6: </b>now check <b><i><span style="text-decoration: underline;">phpinfo</span></i></b> and choose <b><i><span style="text-decoration: underline;">error reporting</span></i></b>
</p>

<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td style="text-align: center;">
      <a style="margin-left: auto; margin-right: auto;" href="http://3.bp.blogspot.com/-mknTXnHyguI/UEuM4Tb9XkI/AAAAAAAAGwg/wk_YHIt5SQA/s1600/error.png"><img title="php installation iis" alt="php installation iis" src="http://3.bp.blogspot.com/-mknTXnHyguI/UEuM4Tb9XkI/AAAAAAAAGwg/wk_YHIt5SQA/s640/error.png" width="640" height="340" border="0" /></a>
    </td>
  </tr>
  
  <tr>
    <td class="tr-caption" style="text-align: center;">
      set error reporting
    </td>
  </tr>
</table>

<div style="text-align: center;">
  <b> </b>
</div>

<p>
  <b><br /> </b><b>7:</b> testing time<br /> open your favorite code editor and type
</p>

<pre class="prettyprint linenums languague-php">&lt;?php echo "Hello World !" ; ?&gt;</pre>

<p>
  and save this as hello.php ( or anything ) on c:inetpubwwwroot<br /> and open <a href="http://localhost/hello.php">http://localhost/hello.php</a>
</p>

<div class="separator" style="clear: both; text-align: center;">
</div>

<div class="separator" style="clear: both; text-align: center;">
  <a style="margin-left: 1em; margin-right: 1em;" href="http://1.bp.blogspot.com/-3cr2Le5pdls/UEuQrO-uJmI/AAAAAAAAGxo/JiIXjtL1Aqw/s1600/php_hello.png"><img alt="" src="http://1.bp.blogspot.com/-3cr2Le5pdls/UEuQrO-uJmI/AAAAAAAAGxo/JiIXjtL1Aqw/s640/php_hello.png" width="640" height="233" border="0" /></a>
</div>

<p>
  now IIS is serving PHP now in next tutorial i will show you how to set up MySQL in windows
</p>

  • Home
  • About