How to connect to remote MSSQL database using php 5.5.19

我是研究僧i 提交于 2019-12-24 13:50:31

问题


I have had a problem trying to establish a connection to a MSSQL database I created in Microsoft SQL Server Manager 2008 R2 using php 5.5.19 in XAMPP.

In the php.ino configuration file under extensions, there is commented out a ';extension=php_mssql.dll'. I removed the comment and ran apache in the xampp control panel. Naturally an error occurred stating ''PHP Startup: Unable to load dynamic library '..\ext\php_mssql.dll cannot be found'. I looked in the ext directory and sure enough it wasn't there. I added the mssql.dll file from

www.dll-files.com/dllindex/dll-files.shtml?php_mssql

,but then I got an Entry Point not found error stating 'The procedure entry point php_body_write could not be located in the dll php5ts.dll'.

After further research, I discovered that mssql_connect was not working since PHP version 5.3: http://php.net/manual/en/intro.mssql.php I instead tried to use the 'sqlsrv_connect'' function, but I had to install the new drivers from https://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

After reading the readme, I saw that I needed the libraries php_sqlsrv_55_ts.dll and php_pdo_sqlsrv_55_ts.dll to work with xampp's php5ts.dll in the php folder. I added the libraries in the php\ext folder and added corresponding extensions to the new dll's and restarted Apache.

I then got an system error 'The program can't start because MCVCP110.dll is missing from your computer. Try reinstalling the program to fix this problem.' Obviously reinstalling isn't an option as I will lose my new dll's so I verified that MCVCP110.dll is in the php folder, which it was.

Please help, I really need to find a way to load the libraries with the 'sqlsrv_connect' function properly so I can connect to a MSSQL database.

来源:https://stackoverflow.com/questions/28201835/how-to-connect-to-remote-mssql-database-using-php-5-5-19

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!