Host PHP application on IIS and then DB driver error - php

I have a PHP application that is already hosted on Windows IIS Server.But when i try to run it now then it shows me the error."db driver not found".BUT i have installed Microsoft Drivers 5.6 for PHP for SQL Server .But still getting error.I'm using SQL Server Express 14.0.1000.169 version.
Is this a correct driver version to download ? or what is the error?.

firstly, are you sure you chose the correct dll for your computer to be the php extension? version, thread safety, system architecture. All of these matter. If that is correct then you can move on to the next step which are drivers.

Related

How to get SQLSRV on Xampp working with Medoo?

I got a PHP project which uses Medoo for accessing a database on MS SQL Server 2012. I used to test my project on the same server, but since copy-pasting through remote desktop got kinda annoying and inefficient, I wanted to move on a local system, so I installed Xampp (with PHP 5.6.19 VC11). Since I still need to use the server database, I first encountered the problem that the PDO MSSQL extension is not available anymore, and my script failed to send a query to the database. So tried using the SQLSRV 3.0 extension instead (5.4 thread-safe - why isn't there a version 5.6? Is 5.4 supposed to be forward compatible?), which still sends me an uncaught exception with message 'could not find driver', thrown from the PDO constructor and forwarded through Medoo. I'm not sure if this fails on Medoo, the driver, or something else. Moving the database to phpMyAdmin is no option... Has anyone an idea how I can solve this?
All information you need are on this this web page https://msdn.microsoft.com/en-us/library/cc296170(v=sql.105).aspx.
As you can see you need version 3.2 for PHP 5.6 support. I found download link and information about adding SQLSRV extension to php.ini for you.
https://www.microsoft.com/en-us/download/details.aspx?id=20098
https://msdn.microsoft.com/en-us/library/cc296203(v=sql.105).aspx
Finally you have to install Microsoft ODBC Driver 11 for SQL Server.
In short, download SQLSRV 3.2, add PDO extension to php.ini (choose right version for your PHP), install Microsoft ODBC Driver 11 for SQL Server on your local enviroment.

Getting PHP Sql Server Driver working in PHP 5.5

I am trying to get PHP with the SQL Server driver working under IIS. I had a similar situation 18 months ago with lesser versions of the php and the driver and Apache, and that code worked fine working on Windows Server 2003.
I am trying to set it up on my Windows 7 (Home Premium) Virtual Machine to work out how to do it, before attempting to get the same done on a Windows Server 2011.
Now I am coming to try the same code again and reset up my development environment. This time I am using PHP 5.5 and have installed the threadsafe version version of the driver php_pdo_sqlsrv_55_ts.dll obtained from the downloadable SQLSERVER31.exe file.
Doing all of this in 32 bit mode
As soon as I try and construct a new PDO I get the following error message
SQLSTATE[IMSSP]: This extension requires the 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
So although that link isn't directly to the driver, I eventually find my way there and download it, only for it to fail to install. However, I think that might be because I already have the ODBC Driver 11 for SQL Server installed.
So according to my Data Sources (ODBC) application in the Administrative Tools Section there are two SQL Server ODBC drivers
SQL Server, verion 6.01.7602.17514 SQLSRV32.DLL Dated 21/11/2010
SQL Server Native Client 11, version 2011.110.5058.00 SQLNCLI11.DLL Dated 15/05/2014
So I really don't know how to go from here.
Can I remove a driver and re-install it. If so how?
Any other suggestions as to how to get this to work.
I discovered the answer to my problem. I hadn't installed the odbc driver - the drivers listed above are not the correct ones.
The reason the ODBC driver I downloaded failed to install wasn't because the driver was already installed - it was because I had downloaded the 32 bit version, and it HAS to be the 64 bit version.
As soon as I installed the 64 bit version, another entry appeared in the Data Sources Driver list, and my test program started to work

connect php with mssql while using iis

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.

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

Mysqli and OCI8 activation on Redhat Linux

I am a novice developer in web, and I have the following situation:
One of my customers wants to 'activate' php extensions for mysqli and oracle (oci8) on a Redhat Linux server.
The actual goal would be to be able to communicate (connect) with a remote Oracle database , which is located on a remote Unix server.
What do I have to do in order to implement those requirements?
Also note that any actions have to be available for command line, since I only have remote access to the Redhat server.
Thank you in advance.
p.s:
The Redhat server already has the following installed:
Oracle 10g.2
php 5.1.6
Apache 2.2.3

Categories