Trying to install MSSQL drivers with EasyPHP 12

旧城冷巷雨未停 提交于 2019-12-23 03:25:30

问题


Recently I formatted my laptop and installed a fresh copy of Windows 7 Home Basic 64bit, EasyPHP 12.1 (upgraded PHP to version 5.4.6), Microsoft SQL Server 2012 and the SQL Native Client Interface 64bit version as specified in the requirements on Microsoft's website. I have downloaded the Microsoft SQL drivers for PHP (a file SQLSRV30.exe) and copied files php_pdo_sqlsrv_54_ts.dll and php_sqlsrv_54_ts.dll to ext folder.

http://postimage.org/image/mv4dcc3aj/

Also added entries to php.ini

http://postimage.org/image/ruwxxeknj/

I am using the thread safe version according to the snapshot file of EasyPHP, it says Build: C:\php-sdk\php54dev\vc9\x86\obj\Release_TS

Well phpinfo() does not show any support for Microsoft SQL Server! I have done this before and I know that it works. Can anyone help me out here, am I missing something from php.ini or somewhere else?

Thanks


回答1:


Eventually I found the problem! I was modifying the wrong php.ini file!

A search for php.ini in C:\Program files(86)\EasyPHP-12.1 revealed 4 files! I decided to change the value of html_errors from On to Off in all of them just to see the effect in the output of php_info(). By trial and error I found that the correct php.ini to change is

C:\Program files(86)\EasyPHP-12.1\apache\php.ini

in there a line says

extension_dir = "C:\PROGRA~2\EASYPH~1.1\php\php546x130128105026\ext\"

so then I realised Apache's php.ini is fetching the DLL files from an outside folder, while I was modifying a different php.ini in directory

C:\Program Files (x86)\EasyPHP-12.1\php\php546x130128105026

which contains the ext folder! Well I was doing it wrong. I kept the two DLL files in that ext folder and added these two lines in Apache's php.ini

extension=php_sqlsrv_54_ts.dll extension=php_pdo_sqlsrv_54_ts.dll

so now EasyPHP can talk to Microsoft's SQL server as shown in the php_info() output.

http://postimage.org/image/f3psxpnvn/



来源:https://stackoverflow.com/questions/14631988/trying-to-install-mssql-drivers-with-easyphp-12

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