I have mssql_* functions working on my Ubuntu installation and want to duplicate this on my windows 7 box. I have installed wamp on the win7 box, but I cannot get it to see the mssql_* functions. I have read many posts about nothing is working. I have the ext directory properly set. I have extension=php_mssql.dll do not see the mssql section in phpinfo, but I do see sqlsrv section. I would like my prod and test environment to match.
Thanks in advance for any assistance
Dean-O
I just checked my local wampserver 2.1 installation, and although there's an option to enable the php_mssql extension, it's missing from the extensions directory.
You can try the FreeTDS extension, which supposedly works fine under both *nix and Windows.
The Moodle wiki specifies that the Microsoft SQL Server driver has "known problems":
WARNING: This driver has known problems and is therefore not suitable
for any Moodle production servers.
and recommends the use of FreeTDS instead (by installing the php_dblib extension). Moodle is a known user of MSSQL, and a respected project, but they don't really specify what they mean by "known problems", so you can take this with a grain of salt...
http://docs.moodle.org/24/en/Installing_MSSQL_for_PHP
If FreeTDS doesn't work for you, you can try installing the official Microsoft drivers:
http://www.microsoft.com/en-us/download/details.aspx?id=20098
Related
WAMP is relatively new ground to me. I have currently only done basic installations and vhosts configurations.
Issue
I am trying to get the PDO drivers installed on my WAMP server so I can connect to SQL Server Databases. From a previous question I asked it was determined i do not have the correct drivers.
Attempts
I have downloaded the drivers from here but I am still not sure which drivers I need to be using. My Apache and PhP build are as follows Apache/2.4.9 (Win32) PHP/5.5.12
I have installed the SQLSRV32.EXE downloaded from the Microsoft page and put it into the PHP extensions on WAMP. a lot of pdo options now show up but they have a red warning sign above them. even though i can see these with the red warning sign I continue to get PDO drivers not found error message when I try to connect to the database.
Resources
so you can see my current php_info I have pasted it into my chrome here
It's a common problem, and one I've solved for a few people recently. Make sure you check the following list to ensure you have put them in place:
Ensure both php_pdo_sqlsrv_54_ts.dll and php_sqlsrv_54_ts.dll are in your /ext directory.
Ensure the following lines are present in your php.ini file: extension=php_pdo_sqlsrv_54_ts.dll & extension=php_sqlsrv_54_ts.dll.
Ensure you have installed VC++ redist located here. Make sure you download and install the x86 version regardless of the architecture of your OS otherwise this will not work.
Check these things and come back to me with an answer.
According to the ADODB:
http://adodb.sourceforge.net/
documentation, it can be used for a number of databases on "Unix and Windows", so I'm assuming that includes OSX.
I've enabled PHP in my Apache installation, installed ADODB and modified include_path to include the ADODB directory, however I'm at a loss as to how to enable particular drivers. I have Firebird installed, so I'd prefer to connect to that, however I'm open to using some other database server.
I've managed to work it all out on a Windows install, however there seems to be scant information on how to do it on OSX.
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.
I have successfully configured php in IIS. sample php pages working fine. now i want to connect it to sql server i tried it by downloading a mssql .dll file in ext folder,I also tried by installing a extension for windows driver, then also it is not working. please help to sort out this issue. I am Using php5.3.19 for the same.
In order to use PHP 5.3 with SQL Server (2005 and above), you will need the Microsoft Drivers for PHP for SQL Server. There are two versions available: 2.0 and 3.0. 3.0 includes support for SQL Server 2012 and PHP 5.4.
You can find instructions for installing the dlls and interfacing with SQL Server in a TechNet article.
To install the extensions, you must move them into your ext folder and add a line to php.ini to load them, like the following:
extension=php_sqlsrv_53_nts_vc9.dll
Once this is done, restart the web server and load phpinfo in order to see if the extension has loaded. If it has loaded correctly, you should see a "sqlsrv" section in PHPInfo.
When the time comes for you to begin writing PHP that connects to SQL Server, make sure you have installed the native client. The current version is the SQL Server 2012 Native Client. References for the API are available on TechNet and PHP.net.
Finally, consider upgrading to PHP 5.4. The 3.0 versions of the drivers support 5.4 but the 2.0 versions do not; if you cannot install 3.0 on your system, you can find a 5.4-compatible version of the DLL (sqlsrv-5.4-nts-snap.zip or
sqlsrv-5.4-ts-snap.zip) on PHP.net. I have had good results with these versions.
I have set up a XAMPP installation on a windows server 2008 R2 that includes:
Apache 2
PHP 5.3.x
MySQL (not used anyway)
Then I have installed PostGreSQL 9.x. I have uncommented the pgsql pdo dlls in the php.ini file accordingly but when I try to connect to pgsql I get 'driver could not be loaded'. I am stuck as I couldn't come across a fix to that on the internet, I have tried adding the path of the pgsql installation (bin and lib dirs) to the PATH environement system but the problem persists. I have also rebooted the system many times after changing any configuration to ensure it is saved and applied but still same outcome.
I have read in a nonclear conversation that this might be related to the versions but couldn't find anything further.
If you have succeeded in performing the latter I would be greateful if you could provide me with some insight. (I am open to any alternatives except downgrading to older software versions).
Thanks so much for your time
Fixed by manually installing apache2 and php instead of going through xampp (or wampp). It seems those are buggy when it comes to the latest php version and pgsql pdo driver.