Configure Windows 10 WAMP PHP to connect to SQLServer 2008 - php

I have been spending days on this project trying to connect to a database and have reached some what of a stand still. I'm hoping someone has some experience with this.
I have been given Remote Desktop credentials to a Windows Server(R) 2008 box. There is a database running on that machine, and the client would like to pull data out of it from another domain - it is running SQLServer 2008.
As a test I am trying to connect to it via a local WAMP install. I was able to get the following .dll's running in my local PHP after downgrading it to its 32 bit version:
- php_pdo_sqlsrv_55_ts.dll
- php_sqlsrv_55_ts.dll
However, when I try to use PDO or the sqlsrv_connect function to connect, I receive the error message:
SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712
When I try to download and install the Microsoft ODBC Driver 11 (https://www.microsoft.com/en-us/download/details.aspx?id=36434) - I receive the following error message:
Installation of this product failed because it is not supported on this operating system. For information on supported configurations, see the product documentation.
My question is, is there a way to connect to a SQLServer 2008 database from a WAMP install on a Windows 10 machine? - as far as I can tell it is not supported on Windows 10.
Thank you for your time.

I'm on Windows 10. I have the 64bit wamp server installed running php 7.0.10.
I was able to connect to a Microsoft Azure database.
I had to install The
Microsoft® ODBC Driver 11 for SQL Server® - Windows
this version of it
ENU\x64\msodbcsql.msi
This is the url:
https://www.microsoft.com/en-us/download/details.aspx?id=36434
I also had to load "php_pdo_sqlsrv_7_ts_x64.dll" file to the folder
C:/wamp64/bin/php/php7.0.10/ext
and add the
extension=php_pdo_odbc.dll
extension=php_pdo_sqlsrv_7_ts_x64.dll
to the php.ini file
this was for a Cakephp 3.55 project

Related

PDO driver stopped working with error of start using ODBC instead? without version?

Recently our SQL Server database has been upgraded and my PDO driver stoped working.
Currently im getting error:
SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver for
SQL Server to communicate with SQL Server. Access the following URL to
download the ODBC Driver for SQL Server for x64:
https://go.microsoft.com/fwlink/?LinkId=163712
When i connect to the db via MSSMC I see:
Operation System: Microsoft Windows NT 6.3 (14393)
Platform: NT x64
Version: 13.0.5292.0
and my PHP server runs on:
Linux x64
PHP Version 7.2.5
Thread Safely: disabled
Currently PDO Driver is loaded for SQLSRV in version 5.8.0
All was working to recently just fine, from noe on just stopped with that error :(
Can I kindly ask you to help me choose the correct driver file?
from the link in the error its very confusing to choose which .so file it realy should be used.
Thank you

PHP with OCI8 Oracle connection on Windows 10 x64 and Windows Server 2008 x64

I am struggling with the setup of an Oracle database connection in Windows x64
My system:
Windows 10 x64 as client PC
Windows Server 2008 x64 as DBServer in the local network
PHP 7.2 TS Windows x64 installation Oracle Database
11.2 Oracle Database Client (present installation of 2014 do not now version, must be a x64 because it runs on server 64 bit)
Other Connections:
SQL Plus connection is working on server and on client PC SQL
Developer is connected to Database on server and works on client PC too.
Just the connection over PHP to the Database is making huge problems.
I know it is a x64 system so I installed the php 7.2 TS for windows x64.
I do not even come to connect to the Oracle Database Client... because the installation of the oci8.dll extension is failing.
What I did so far:
I uncommented the extentinos in the php.ini: OCI8.dll and the OCI8_11g.dll and put it into the php/ext directory.
I set an absolute path to the ext-folder in php.ini
When trying to load php in the command prompt with extention oci8 or oci8_11g enabled it says:
[path to the ext] not a Windows32 application or ...dll not found - but the directory is correct and the ddl-file is there.
I tried to set up an apache server from apachelounge build x64 and it is running. PHP7 is installed as an implemented apache module and the oci8 is enabled. But still it does give me the PHP warning message of [path to the ext] not ...dll not found.
I do not know what to do now. My windows 10 is a new installation. I did not change the system variables. PHP is just not taking the extesion.
You can find the phpinfo of my client PC uploaded as a screenshot here:
https://ibb.co/iPJ4W7
Any suggestions?
Thank you for your help.

PHP 7 on IIS: Call_user_function could not be located

I am trying to use the Microsoft SQL Server drivers with PHP 7.1 Not Thread Safe x64 on Windows 2012 R2 64-bit server.
No matter what I do I am getting an error when I run php from a admin command prompt
Warning: PHP Startup: Unable to load dynamic library
'ext\php_pdo_sqlsrv_7_nts.dll' - The specified procedure could not be
found.
Additionally it display a windows pop up that states
The procedure entry point call_user_function could not be located in
the dynamic link library C:\PHP7\ext\php_pdo_dqlsrv7_nts_x64.dll
I have verified that the php.ini is pointing to a file that exists, because if I rename the .dll file, the error messages changes to "specified module could not be found", instead of specified procedure.
I have installed Microsoft Visual C++ runtime 15 x64 as required by PHP 7.
I have installed Microsoft ODBC driver 13 as required by the Microsoft SQL Server driver.
I have rebooted the server twice.
There is nothing else I can think to even try. The Microsoft WinCache.dll is loading and working fine in PHP, as verified by phpinfo.
Confirmed what #MEmerson said above. You need to downgrade PHP to 7.0.X(?) - I used 7.0.12.
Complete Setup:
Windows 10 Pro
PHP X64 7.0.12 TS (Bitnami WAMP Stack)
Microsoft ODBC Driver 13.1 for SQL Server (https://msdn.microsoft.com/en-us/library/mt703139(v=sql.1).aspx)
Microsoft Drivers for PHP for SQL Server 4.0 (https://www.microsoft.com/en-ca/download/details.aspx?id=20098)
Same drivers with PHP X64 7.1.0 produced the error you are getting.
Microsoft Drivers 4.3 for PHP for SQL Server are now available.
These drivers contains files for PHP 7.1 - php_pdo_sqlsrv_71_nts_x64.dll etc.
I've successfully managed to connect to SQL server.
Had similar error when tried to use httpd (Apache), PHP 7.2.2, Microsoft ODBC driver 11 on MS Windows Server 2012. The text of error was:
The procedure entry point call_user_function could not be located in the dynamic link library php_pdo_sqlsrv_7_ts_x64.dll.
when I called php -m to check modules.
So I have downloaded Windows-7.2.zip from https://github.com/Microsoft/msphpsql/releases and used thread-safe dlls from it.
php -m works now as it should without giving error.
Same as NoCopy
Windows Server 2012
php-7.0.15-Win32-VC14-x64.zip from (http://windows.php.net/download)
Visual C++ Redistributable for Visual Studio 2015 (https://www.microsoft.com/en-us/download/details.aspx?id=48145)
Microsoft ODBC Driver 13.1 for SQL Server
Microsoft Drivers for PHP for SQL Server 4.0
7.1.x still a No,NO from Microsoft
It happened to me today while enabling the extensions in the IIS, where I by mistake enabled different versions for pdo & driver extensions (E.g. php_sqlsrv_7_nts_x86.dll for PHP 7.0 & php_pdo_sqlsrv_72_nts_x86.dll for PHP 7.2).
Usually the package that you download from Microsoft that contains Microsoft Drivers 5.3 for PHP for SQL Server has all the PHP extensions versions. https://www.microsoft.com/en-us/download/details.aspx?id=57163
Just make sure you enable both extensions for the same versions to avoid that error.

sqlsrv drivers doesn't appear on a WAMP server phphinfo() after adding the extension entries in the php.ini file

I wanted to setup a database connection from PHP to SQL server 2012.I have a wamp server(64 bit) set up on a windows machine(64 bit) with PHP 5.5.12 and on the same machine I have SQL server 2012 installed.
Extracted sqlsrv drivers from official_link
Copied the extracted drivers php_sqlsrv_55_ts.dll, extension = php_pdo_sqlsrv_55_ts.dll to php\ext folder, and then changed the php.ini file to include the extensions
extension = php_sqlsrv_55_ts.dll; extension = php_pdo_sqlsrv_55_ts.dll;
Now I tried
<?php
phpinfo();
?>
I see the following information without any SQL server information in it.
Don't seem to have configured SQL server connection successfully. Could some one please guide me on what I am missing here.
64 bit WAMP server was not able to connect using the drivers extension = php_sqlsrv_55_ts.dll; extension = php_pdo_sqlsrv_55_ts.dll;
So, I installed a 32 bit version of the WAMP server and it works fine now.
Check the php error log (c:\wamp\logs\php_error.log).
I had the same setup (64bit WAMP/PHP 5.5.12) and same missing sqlsrv reference in phpinfo and I got this error in my log:
PHP Warning: PHP Startup: Unable to load dynamic library
'c:/wamp/bin/php/php5.5.12/ext/php_pdo_sqlsrv_55_ts.dll' - %1 is not a
valid Win32 application. in Unknown on line 0
The solution was to install the 64bit version of the sqlsrv drivers. I found the unofficial 64bit drivers through http://robsphp.blogspot.nl/2012/06/unofficial-microsoft-sql-server-driver.html
Warning: In my testing I found these 64bit PHP_PDO_SQLSRV extension 10 times slower than when using PHP_PDO_ODBC.
I am visiting this thread and i think this might help full for you and other with the same issue:
How can I install pdo_sqlsrv on my windows 2008 Server 2008 R2?
The PDO Extension is not the same as the native driver Microsoft is offering. For PDO you must enable
extension=php_pdo_mssql.dll
in your php.ini.
{Normally this file (php_pdo_mssql.dll) should be in your PHP extension-directory (C:...\php\ext). If it's not there you can download PHP from http://windows.php.net/download/ and just take the extension from a package there (take one that correspond with your PHP version of course)}.
Above is taken from PDO MSSQL Server - Driver not found
read for more details. i have the same issue foe linux and i have saved all the pages thats why i am quoting for you help.
if all above didn't work for you then:
On the php.net it is listed that
On Windows, PDO_ODBC is built into the PHP core by default. It is linked against the Windows ODBC Driver Manager so that PHP can connect to any database cataloged as a System DSN, and is the recommended driver for connecting to Microsoft SQL Server databases.
http://php.net/manual/en/ref.pdo-odbc.php
You can connect to mssql server using odbc drivers as i have never connect by my self from windows i use to do it through linux using freeTds, following pages might help you
http://craigballinger.com/blog/2011/08/usin-php-5-3-with-mssql-pdo-on-windows/
Connect PHP to MSSQL via PDO ODBC
PHP to SQL Server without ODBC or MSSQL support

Not getting connected to Sql Server 2012

I am getting following error while connecting to Sql Server 2012 in Laravel 4
PDOException SQLSTATE[IMSSP]: This extension requires the Microsoft
SQL Server 2012 Native Client ODBC Driver to communicate with SQL
Server. Access the following URL to download the Microsoft SQL Server
2012 Native Client ODBC driver for x86:
http://go.microsoft.com/fwlink/?LinkId=163712
As per this link
http://msdn.microsoft.com/en-us/library/cc296170.aspx
I downloaded and installed these two files in xampp/php/etc/ folder
php_sqlsrv_54_ts.dll
php_pdo_sqlsrv_54_ts.dll
And added these two in the php.ini file. But still I am seeing the same error.
I am using windows 7 and xampp. Please help.
I removed Xampp and installed Wamp (32 bit) server on my Windows 7, because after following almost every tutorial my xampp installation became unstable.
Following are the steps that resulted in successful connection to SQL SERVER 2012.
Download Microsoft SQL Driver for PHP
http://www.microsoft.com/en-in/download/details.aspx?id=20098
Click on the exe to extract it copy below two dlls
Add Extensions in the D:\wamp\bin\apache\Apache2.4.4\bin\php.ini
extension=php_pdo_sqlsrv_54_ts.dll
extension=php_sqlsrv_54_ts.dll
After that I downloaded and installed this Microsoft Sql Server 2012 SP1 Feature Pack
http://www.microsoft.com/en-in/download/details.aspx?id=35580
After this restart your computer.You should see these two blocks in your phpinof() output
thats it. Hope this will help someone.

Categories