How to run PHP files from Visual Studio

This will allow you to run PHP code from Visual Studio using IIS. However, you wont be able to debug php with this option.

I had installed in my machine SQL 2008 and Visual Studio 2012; I did not have IIS installed so I will show you how to go thru the whole process.

Before you start make sure you download the PHP files from: http://windows.php.net/download/

 downloadPHP

I extracted the files to C:\PHP\ folder I created.

Begin by installing IIS with the proper settings:

controllpanel

Make sure you have the CGI Option (see below)

addfeaturecgi 

Once installed go to Start > Run > 

  • inetmgr

double click on Handler Mappings and add a Module Mapping; Follow Instructions bellow:

addmodule

click on Request Restrictions and make sure “Invoke handler only if request is mapped to” is checked with file option.(see bellow)

requestrestrictions

Press OK and yes

module-yes   

I added a Folder called “06″  to C:\inetpub\wwwroot\ with some PHP files

you may create or add a folder to work with in Visual Studio.

Open Visual Studio File > Open > Web Site

open06

 

Happy Coding :)

reference:
Video Sample

Related Posts

No Comments Yet.

Leave a reply

You must be logged in to post a comment.