Barra de espaço
Barra de espaço

This tutorial describes a detailed procedure showing how to perform the installation of PHP on a computer running Windows 2012 and IIS 7.

YOUTUBE

In our channel you can view the video of this tutorial.



Click on this link to access the download page of PHP for Windows.(LINK)

  • Download PHP, version non thread safe. (LINK)
  • Download the correct version of Visual C++ Studio 2012 to your PHP version. (LINK)


Install Visual C++ Redistributable for Visual Studio.

Note! For each PHP version there is a version of visual studio to be properly installed and the PHP site tells you what the correct version to use.


After finishing the installation of Visual Studio, extract PHP and move it´s content to a folder named PHP in the root of drive C.

Right click on My Computer and select properties to be presented to a new windows, then, click on the Advanced system settings option.

amazon aws instalacao do ec2 api tools no windows 2008 1


Edit the PATH environment variable and add the path to the C:\php folder.

  • Before - PATH=C:\ProgramData\Oracle\Java\javapath;c:\Program Files (x86)\CA\SC\CAWIN\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%CSAM_SOCKADAPTER%bin;c:\Program Files (x86)\CA\SC\CBB\;c:\Program Files (x86)\CA\DSM\bin;c:\PROGRA~2\CA\SC\CAM\bin;C:\Program Files\Dell\SysMgt\shared\bin;
  • After - PATH=C:\ProgramData\Oracle\Java\javapath;c:\Program Files (x86)\CA\SC\CAWIN\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%CSAM_SOCKADAPTER%bin;c:\Program Files (x86)\CA\SC\CBB\;c:\Program Files (x86)\CA\DSM\bin;c:\PROGRA~2\CA\SC\CAM\bin;C:\Program Files\Dell\SysMgt\shared\bin;C:\php

 

Go to C:\PHP and rename the php.ini-production file for PHP.ini

Edit the php.ini file to enable and change the following items.

windows 2008 instalar php no iis 7 5 1

 

Note! Enable means to remove the first comment character from the beginning of the line in this case is the character ";"



Open a command prompt and run the following command to verify that PHP was installed correctly.

C:\> php -info

 

The php has been successfully installed. So, do the installation of IIS as demonstrated in the video below. (LINK)




After finishing the IIS installation go to  the administrative interface of your web server by clicking the Start menu, select Administrative Tools and click on Internet Information Services Manager option (IIS).

At this point it is necessary to add support for PHP on IIS, for that select the handler mappings option. 

windows 2008 instalar php no iis 7 5 4

Add the following module mapping.

windows 2008 instalar php no iis 7 5 5


When finished adding support for PHP configure IIS to interpret index homepages in PHP. Just select the default document option.

windows 2008 instalar php no iis 7 5 2

 
Add index.php to the top of the displayed list.

 

windows 2008 instalar php no iis 7 5 3

 

Note! Restart IIS so that the settings are fully activated.

To test your settings, open the notepad and create a document called test.php and save this in the IIS root directory C:\inetpub\wwwroot.

windows 2008 instalar php no iis 7 5 6

Open your browser and go to php test page. (Ex: http://127.0.0.1/test.php)

windows 2008 instalar php no iis 7 5 7

 

Your IIS server with PHP support has been successfully installed.

 CONCLUSION

This tutorial presented the installation process of PHP on IIS.