Loading PHP driver for SQL
6 posts
• Page 1 of 1
Loading PHP driver for SQL
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.
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
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,
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. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Loading PHP driver for SQL
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.
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
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
Thanks,
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
Thanks,
You do not have the required permissions to view the files attached to this post.
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Loading PHP driver for SQL
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.
Great support,
Sid.
- sidprice
- Posts: 18
- Joined: December 2nd, 2013, 10:48 pm
Re: Loading PHP driver for SQL
Great! Glad I could help!
Cheers,
Cheers,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 33 guests