Loading PHP driver for SQL

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Loading PHP driver for SQL

Postby sidprice » December 2nd, 2013, 11:16 pm

I realize this may be the wrong place to ask this question but I am hoping someone else has tried the setup I am trying to get working.

I really like "PHP Tools" and it was very easy to get working. My next step, and the one that I cannot get working, is to use the Microsoft Driver for PHP for SQL Server. I installed the driver and followed the instructions for loading the extension by editing the PHP.ini file, however when I try to run my code I get the following error:

"Call to udefined function sqlsrv_connect"

The only part of the instructions I could not do was restarting the web server, however I thought VS starts/stops the web server with each run/stop debugging?

Any help would be much appreciated,
Sid.
sidprice
 
Posts: 18
Joined: December 2nd, 2013, 10:48 pm

Re: Loading PHP driver for SQL

Postby Miloslav Beno » December 3rd, 2013, 9:01 am

Hello!

I assume your are using PHP build-in server?

We doesn't restart the server with each debugging session, but it restarts when you change your php.ini settings. But you can do it manually if you exit our PHP debugger systray.

Checkout also phpinfo() output where is actual php.ini located. Sometimes users find out they have one more php.ini file messing with their main php.ini settings file.

Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Loading PHP driver for SQL

Postby sidprice » December 3rd, 2013, 3:27 pm

Thank you for the reply. I think the extension dir is correct. php.ini has two entries:

Configuration File(php.ini) Path -> c:\windows
Loaded Configuration File -> c:\Program Files\IIS Express\PHP\v5.4\php.ini

The listed file has this in it:

[ExtensionList]
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_curl.dll
extension=php_exif.dll
extension=php_xmlrpc.dll
extension=php_openssl.dll
extension=php_soap.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_imap.dll
extension=php_tidy.dll
extension=php_sqlsrv_53_ts.dll

Restarting the sever did not load the extension.

Hope you can help,
Sid.
sidprice
 
Posts: 18
Joined: December 2nd, 2013, 10:48 pm

Re: Loading PHP driver for SQL

Postby Miloslav Beno » December 3rd, 2013, 6:35 pm

I see you have php_sqlsrv_53_ts.dll, which is the wrong one. That's why PHP is not able to load it. You need version for 5.4 and non-thread-safe.

The easiest way to install it is through Web Platform Installer. Just open WebPI and choose Microsoft Drivers 3.0 for PHP 5.4. for SQL Server in IIS Express (it will work even if you don't have IIS Express).

See the screenshot
sqlsrv.png


Thanks,
You do not have the required permissions to view the files attached to this post.
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Loading PHP driver for SQL

Postby sidprice » December 3rd, 2013, 6:51 pm

YES!!! Thanks so much. I had the correct version of the DLL installed I was just including the wrong version in my PHP.ini.

Great support,
Sid.
sidprice
 
Posts: 18
Joined: December 2nd, 2013, 10:48 pm

Re: Loading PHP driver for SQL

Postby Miloslav Beno » December 3rd, 2013, 7:08 pm

Great! Glad I could help!

Cheers,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 33 guests

User Control Panel

Login

Who is online

In total there are 33 users online :: 0 registered, 0 hidden and 33 guests (based on users active over the past 5 minutes)
Most users ever online was 511 on April 27th, 2024, 10:11 pm

Users browsing this forum: No registered users and 33 guests