Answered by:
PHP Driver for Azure SQL Server

Question
-
Hello dear colleagues,
I am new in using Microsoft Azure. I tried recently to implement a web app in php with a connection to an Azure SQL Server DB. While my queries perform perfectly via the SSMS, the same does not happen when running through the web app (the delay exceeds two minutes!). I have tried both sqlsrv driver and azure sql server driver with no difference.
Thanks for the help
Friday, June 9, 2017 10:33 AM
Answers
-
Hello,
Could you please verify that all is hosted in the same region? Putting all in the same region should provide better performance.The following articles may help you troubleshoot performance issues with Joomla.
Hope this helps.
Regards,Alberto Morillo
SQLCoffee.com- Marked as answer by Dimitris Drakopoulos Thursday, June 22, 2017 1:15 PM
Sunday, June 11, 2017 7:37 PM
All replies
-
Hello,
The recommended driver is the following:
https://www.microsoft.com/en-us/download/details.aspx?id=20098
Documentation about how to start using the driver:
https://docs.microsoft.com/en-us/sql/connect/php/microsoft-php-driver-for-sql-server
In terms of performance, please read the following resource:
https://docs.microsoft.com/en-us/sql/connect/php/direct-statement-execution-prepared-statement-execution-pdo-sqlsrv-driver
Hope this helps.
Regards,Alberto Morillo
SQLCoffee.com- Edited by Alberto MorilloMVP Friday, June 9, 2017 11:54 AM
- Proposed as answer by pituachMVP Friday, June 9, 2017 10:53 PM
Friday, June 9, 2017 11:53 AM -
Hi Alberto and thanks for your reply,
Firstly: do I assume correctly the recommended driver is pre-installed in Azure?
Second: Bare in mind my web app is Joomla as installed from within Azure Marketplace. Joomla is using its wrapper on PDO for connecting to SQL Server DB.
What I can configure is this :
public static function getDBXXX() {
$option = array();
$option['driver'] = 'sqlsrv';
$option['host'] = 'xxxxxx.database.windows.net,1433';
$option['user'] = 'yyyyyyy';
$option['password'] = 'PASSWORD';
$option['database'] = 'database';
$option['prefix'] = 's_';
return JDatabase::getInstance( $option );
}
Sunday, June 11, 2017 4:12 PM -
Hello,
Could you please verify that all is hosted in the same region? Putting all in the same region should provide better performance.The following articles may help you troubleshoot performance issues with Joomla.
Hope this helps.
Regards,Alberto Morillo
SQLCoffee.com- Marked as answer by Dimitris Drakopoulos Thursday, June 22, 2017 1:15 PM
Sunday, June 11, 2017 7:37 PM -
During the deployment process of Joomla I have chosen a datacenter in the U.S. to interconnect with an Azure SQL Server DB in West Europe. This was causing a serious latency.
Thanks a lot Alberto
Thursday, June 22, 2017 1:17 PM