Enabling the sqlsrv extension in PHP

software development


Hi guys,

It’s been a while since I’ve made extensive use of the PHP environment on my DH Shared Server - I normally run fully .Net Framework web apps on my own server, so this is entirely new to me.

I have a software package that requires the use of the sqlsvr extension which I do not know how to install/enable etc…

Has anyone done something similar or know how to achieve this?



You should be able to do it with a phprc file. There is documentation here: https://help.dreamhost.com/hc/en-us/articles/214200688


Right, I’ve got the file, I know my site is running under PHP 7.2 (the current recommended option).
I’ve found and edited /home/{user}/.php/7.2/phprc to include the line:

I’ve run the killall command, it didn’t return any errors but my site still throws the error:
Fatal error: Uncaught Error: Call to undefined function sqlsrv_query()

Now what?


You’ll also need to install that .dll file. See this page in the PHP Manual:


I’m not sure if you can do that on shared hosting. It may be time to open a support ticket if there is nothing else in the knowledge base.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.