The following steps show you how to setup your windows machine to host PHP applications. We will be talking about hosting the only supported ( by MS Support ) PHP CGI application on IIS .
Using FastCGI to Host PHP Applications on IIS 7.0
In my php.ini , I have set the value to be date.timezone = "America/Los_Angeles"
Follow the instructions on the codeplex site to setup your machine. Installation and Configuration
I have copied the phpsamples folder from the downloaded phpdataservices1.0 folder into the %SystemDrive%\inetpub\wwwroot folder.This is just so that I dont need to configure any permissions for the IIS accounts. Open the IIS manager by running “INETMGR” from the “run” prompt on the start menu
Select the PHPSamples folder from the “Default Web Site”
Right-Click the Virtual directory and select “Convert to Application”
Confirm creating the virtual directory by pressing “OK” in the next dialog that turns up
This sets up the PHP applications that access the ADO.NET Data Service, We still need to setup the actual Data Services that the PHP Samples access.
Find the ADODotNetDataServices folder in the PHPDataServices1.0 download. This should be under the “samples” directory. i.e PHPDataServices1.0\samples\ADODotNetDataServices
1) Unzip the zipped database files from the
4) In the “Attach Database” dialog , press “Add” and select the unzipped “VideoGameStore_Data.mdf” file. You will notice that once you select the MDF file , the dialog will complain about a missing .ldf file. 5) This is a routine warning , select the ldf file row in the dialog and press “Remove”
For the other database Northwind, you can use the sample database that are available from Download.Microsoft.com Here’s a link to download the Northwind sample database : Northwind and pubs Sample Databases for SQL Server 2000 Installation should be straight-forward as it comes with an MSI that is supposed to setup the database for you.
Disclaimer : I already had a copy of the Northwind database on my machine and didn’t use the installer above. Once you have your databases setup , modify the respective connection strings web.config file from the ADODotNetDataServices project.
<add name="NorthwindEntities" connectionString="metadata=res://*/NorthwindModel.csdl|res://*/NorthwindModel.ssdl|res://*/NorthwindModel.msl; provider=System.Data.SqlClient; provider connection string="YOURCONNECTIONSTRINGHERE"" providerName="System.Data.EntityClient" />
<add name="VideoGameStoreEntities" connectionString="metadata=res://*/VideoGameStoreModel.csdl|res://*/VideoGameStoreModel.ssdl|res://*/VideoGameStoreModel.msl; provider=System.Data.SqlClient; provider connection string="YOURCONNECTIONSTRINGHERE"" providerName="System.Data.EntityClient" />
Now, run the project in Visual studio and launch the PHP samples by browsing to the Index.php page
in the PHPSamples virtual directory.
You should see this as the startup page when you run the PHP Samples
Demo tab contents
Select the ADO.NET Data Services Editor Sample to see some pure PHP awesomeness
Here’s an editor page for the Customers Entity Set:
See that little text box over there ?
Yeah , it allows me to enter the Astoria URI operators like top , skip , filter to filter the rows bound to the grid below.
The gird is editable too , Clicking on the “Detail” link in the first column of the grid brings up an editor for the customers
entity that was selected.
So , there you have it , instructions to setup the samples and some tours of the sample applications.
Since I know next to nothing about PHP , I have a few questions for our PHP-Savvy users.