our wordpress live sample website：
Download sample project here
1. To enable PHP to access SQL Azure, SQL Server Driver must be added to PHP extensions. (For SQL Azure is built on SQL Server).Download it form SQL Server Driver for PHP 2.0.
2．Open and extract it, driver files are listed below.
We choose php_sqlsrv_53_nts_vc9.dll, for it matches our PHP version, VC9 x86 Non Thread Safe.
Put the driver into php\ext folder in the PHP_WebCgiRole project.
Rename php.ini-develop in the php folder to php-ini. Right click on php.ini, choose Properties, and change the value of Build Action to Content.
Click to Open php.ini, look up extension_dir and change its value to “./ext”. It indicates the extension directory of PHP.
Add “extension = php_sqlsrv_53_nts_vc9.dll “to php.ini.
$serverName = “tcp:ServerID.database.windows.net, 1433″;
$connectionOptions = array(“Database” => “yourdatabase“,
“UID” => “yourusername@ServerID“,
“PWD” => “yourpassword“,
$retry = 10;
$conn = sqlsrv_connect($serverName, $connectionOptions);
echo “Connect Success!”;
if($conn === false)
5. Press F5 to debug the application, wait for the browser to start, you’ll see the result below:
You can put it into Windows Azure Hosted service now, and will get the same result.
The process is still simple and easy as before, now you can exploit the power of SQL Azure!
This article will show how easy to run PHP application inWindows Azure
This article describes how to access SQL Azure using PHP.
This article describes the process about host WordPress on Windows Azure. Similarly, you will see how easy it will be.