How to load php_pdo_sqlsrv_54.dll? - php

I'm using WAMP 2.2 (PHP 5.4.3) on Windows 7 64bit and I like to use PHP to connect to MS SQL Server 2005 Express Edition.
I downloaded Microsoft Drivers 3.0 for PHP for SQL Server and unzip the file php_pdo_sqlsrv_54_ts.dll to the php's extension directory.
I appended php.ini with additional "extension=php_pdo_sqlsrv_54_ts.dll".
After restarting WAMP, I got an error message dialog.
How to fix it?
One more thing, why php keep putting pdo_mssql on it's php.ini, is it available anyway?
Thanks.

You use 64-bit while the DLL library you try to use is 32-bit. Read somewhere that WAMP, XAMPP and so on doesn't like that. Try to find a 64-bit version of that DLL.

Related

Cannot load sqlsrv

I don't know if this is the right place to ask this question, if not, please tell me where. I need to connect a php script running on wamp with an MSSQL server. I downloaded and installed the Microsoft Drivers for PHP and added the following lines in php.ini:
extension=php_sqlsrv_55_ts.dll
extension=php_pdo_sqlsrv_55_ts.dll
The weird part is that the extension is shown as loaded when I look for it in the wamp menu, and not found in phpinfo();
(thread safety is enabled, hence I use the ts version)
EDIT
I solved it, wrote the solution below. But, I still cannot get it to work on Windows Server 2008 R2 SP1. Same problem, extension is loaded in the menu, but not on the wamp homepage and phpinfo();
Success, finally.
First, I downloaded an unofficial x64 version of sqlsrv (good job Microsoft on not labeling and leaving only 32bit versions -_-)
Second, I downloaded and installed the SQL Native Client x64.
Hope this helps if anyone else has the same problem.
ЕDIT
I still have the same problem on the same wamp installation on Windows Server 2008 R2 SP1
Do you have Visual C++ Redistributable for Visual Studio? I remember that solved one of my problems. Unfortunately I still have other ones, which I have just posted a question for. I will be trying the x64 version and see if things work. Looks like it is version 3.0, so I suppose ODBC 11 won't work with it and one would need to use native client

How to enable php_mssql.dll extension in xampp 1.8.x

I'm using xampp-win32-1.8.3-1-VC11-installer and i enabled php_mssql.dll extension in php.ini by remove ;
I copy php_mssql.dll to xampp\php\ext
and ntwdblib.dll to xampp\apache\bin
i got 2 files above in old of xampp version.
But when i start my apache in xampp then i get
How to fix that thanks
It announced from php website http://php.net/manual/en/intro.mssql.php
These functions allow you to access MS SQL Server database.
This extension is not available anymore on Windows with PHP 5.3 or later.
SQLSRV, an alternative extension for MS SQL connectivity is available from Microsoft: » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx.
Since XAMPP 1.8.0 its used PHP 5.4.4 and php_mssql.dll extension is not available anymore on windows with PHP 5.3 or later.
So you can't use this library to your new XAMPP although you get it from your old XAMPP.
You must use alternative extension to connect to MS SQL Server database like SQLSRV.
See also ::
http://php.net/manual/en/intro.mssql.php
http://stackoverflow.com/questions/7402713/how-to-get-mssql-work-with-php-5-3
Your php version from XAMPP 1.8.3 is PHP 5.5.15, so you must use "php_sqlsrv_55_nts.dll" or "php_sqlsrv_55_ts.dll". Those files can be downloaded from http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=20098`.
Note :: see also the information on Details section to help you choose file that you must download
This link about documentation to code with sqlsrv library
http://php.net/manual/en/book.sqlsrv.php
Windows PHP extensions are neither forward nor backward compatible between second-level PHP versions. That means you cannot use a PHP 5.3 extension in PHP 5.4 and vice-versa.
As you're running XAMPP 1.8.3 and this is one of the first PHP bundles with the VC11-PHP5.5 builds you'll have to find a VC11-PHP5.5 compatible extension somewhere else.
I've just checked another WAMP bundle called EasyPHP, but they don't ship the MS SQL extension with their VC11-PHP5.5 bundle either.
I can't help with finding a compatible extension, though.
You could also build the extension yourself if that is an option for you.

SQL Server Drivers for PHP 5.3.13

I have been trying to install SQL Server drivers for my wamp server 32 bit ( php ver 5.3.13 ) and I downloaded the drivers from Microsoft download site I copied them to ext folder and changed the php.ini file but I'm still getting errors. Could you please give me a full installation manual I really need to sort this out and start developing some codes on this.
Could you not use PDO this would solve your issues? http://www.php.net/manual/en/ref.pdo-dblib.php
EDIT:
Download SQL driver for PHP - http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx and http://www.microsoft.com/en-us/download/details.aspx?id=20098

PHP can't connect with Oracle Database

I have installed Vertrigo Server with [Apache 2.0] & [PHP 5.2.14] on Windows XP X32 but Vertrigo server doesn't includes OCI8.DLL extension for Oracle Database. When I tried to copy this DLL file from another version of PHP I got Apache error:
[v_apache.exe]: The application cannot start because php5.dll is
missing.
Without this DLL file everything is wokrking OK, but I need to connect with oracle Database. Have you any solutions how to add OCI8.DLL extension in that version of PHP and Apache?
Thanks.
Simpliest way is to use Zend Server CE.
It has latest stable apache with latest stable PHP stack, also with oci libraries (and much more).
Download for free (registration required).
After long time searching over the internet finaly I found soltion for it. Strange is that Apache doesn't alert error about real problem, it just says that problem is with 80 port, even when 80 port is free.
Solution is very simle: I just installed Microsoft Visual C++ 2010 Redistributable Package and after averithing was running correctly.

mssql_connect in PHP does not exist

I've been struggling with this for a while now and I don't know what I'm missing. The error is:
call to undefined function mssql_connect()
Having looked into it already, I've done about everything I can.
I moved the php.ini file to c:\windows
In the ini I changed the extension_dir directive to c:PHP\ext and uncommented:
extension = php_mssql.dll
I moved the dll file to c:windows\system32\
I downloaded the 200.80.194.0 version of ntwdblib.dll and placed it in c:\windows\system32
I restarted my web server client
PHP is still not recognizing the function and library classes. I'm stumped as to what I didn't do right and would love some help. If it's helpful, I'm running PHP 5.3.2, IIS, and Microsoft SQL Server 2008.
For SQL Server 2008 on Windows it's sqlsrv_connect This is because Microsoft now uses the SQL Driver for PHP which is now on version 2.0 I believe.
Also it's worth noting that with sqlsrv_query, and mssql_query they switched the parameters around (spent half an hour figuring that out).
You say you are running PHP 5.3.2. The PHP manual states:
This extension is not available anymore on Windows with PHP 5.3 or later.
The PHP MSSQL library is ancient and is no longer considered a viable option.
You should instead examine PDO with either the MSSQL driver or the more reliable ODBC driver.
Microsoft are still developing their own PDO driver. Version 2 was made available June 2010. Microsoft recommend the more stable version 1.1 for production use.

Categories