Connecting to SQL Server from PHP running on a Linux server |
6/4/2021 4:44:44 PM |
PHPRunner Tips and Tricks | |
![]() While this is not the most traditional setup, connecting from LInux server's PHP to SQL Server database is possible and here are the steps.
Configure ODBC driver on Linux server Testing your ODBC driver installation The key is to execute the following command on your Ubuntu server: Now in PHPRunner you can add a new database connection and use the following connection string: |
|
![]() |
Dalkeith 6/7/2021 |
Good timing I tried this the other day trying to link to an SQL Azure database but failed because no odbc on the linux server. If I can get it to work it will reduce my hosting charges. |
![]() |
Dalkeith 6/7/2021 |
I should add that if you are using Microsoft Azure, a phprunner application hosted within a linux hosted web app linked to SQL Azure database, performance is fantastic. I believe they have the odbc driver pre-installed when you set up a linux web application host as I didn't have to do this configuration to make it work just connected through PHPrunners configuration and it was go. |