how to connect php to oracle 11g and oracle8 - php

I am on linux redhat 6 enterprise. I have php set up to connect to oracle 11g, I would like to connect it to oracle 8, how can i do this?
I have tried using the current drivers installed but it does not work.
PHP Warning: oci_connect(): ORA-03134: Connections to this server version are no longer supported. in /var/SP/oiadm/docroot/common/php/DatabaseConnection.php on line 112

Your problem is because your client version (which used to compile oci8 you are using) is not compatible with Oracle 8 server.
This is the matrix (image format) for the Oracle client / server interoperabillity:
And the meaning:
Extracted from here <- where is 12 version? I'm trying to get a newer one.

Related

php 7.2 (64-bit) can't find MS Access drivers

I upgraded php from 7.0 to 7.2 on my Windows2012 server, and now my php script cannot access my MS Access database. Everything worked fine until the moment I upgraded. I made sure pdo_odbc.dll is enabled in the new php.ini.
I get the error:
Uncaught PDOException: SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Drivers for MS Access are installed, but they are 32-bit. I am looking in both the ODBC Administrator dialogs. Drivers are there in the 32-bit and not in the 64-bit. The server is 64 bit and the new php is 64-bit. Windows on the server is all 32-bit and I cannot change this. Windows installer refuses to install the 64-bit drivers.
I tried to install 64-bit drivers from the command line with the /passive switch as referenced here: Hand Install of 64-bit MS Access ODBC drivers when 32-bit Office is present
But this did not work, just gave the same error message about you can't install 64-bit drivers because your Windows environment is 32-bit.
Changing databases is, unfortunately, not currently an option.
Am I right that this is an issue with the 32-bit drivers vs 64-bit php? Or could it be something else? Is there any way to get the drivers? If I did, would it endanger the functioning of the database? Thanks for any input.

Configure Windows 10 WAMP PHP to connect to SQLServer 2008

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

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

Is there MSSQL Server Driver for PHP on a 64-bit environment?

Is there a driver for MSSQL Server for PHP (64-bit)?
I have Apache 2.4 (64-bit) environment installed. Also PHP 5.5.12 (64-bit)
I have search for MSSQL Server driver "on the net" for php 64-bit but I found nothing. All I can find is a 32-bit. Also, all the articles that I found were old and nothing recent.
I tried to install the 32-bit driver but I get a warning when executing C:\php>php -m
This is the warning
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_sqlsrv_54_ts.dll' - %1 is not a valid Win32 application. in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_pdo_sqlsrv_54_ts.dll' - %1 is not a valid Win32 application. in Unknown on line 0
I downloaded the MSSQL Server Driver from Microsoft Drivers 3.0 for PHP for SQL Server
If there a MSSQL Server driver available for PHP 64-bit environment?
If not is there a workaround beside having to go back to 32-bit PHP environment?
I have run into this issue as well. What I have found is that you need to make sure that the extension=php_sqlsrv_54_ts.dll area of your php.ini file is only uncommented on the Apache location of php.ini.
For example:
if you have C:\Webserver\bin\apache\bin\php.ini, you probably have a C:\Webserver\bin\php\php.ini as well. Make sure your extension referrences are ONLY in the ...\apache\bin\php.ini.
It took me 3 hours to realize there were 2 different php.ini files and that the error was throwing because I had the extension initialized in the wrong php.ini file yet it was still looking there for some reason. I hope this helped.
Have you tried updating to php 7 ?
The x64 builds of PHP 5 for Windows are experimental, and do not provide 64-bit integer or large file support. Therefore I doubt MS will release a php5 version of the driver especially since the one for php 7 has been out for a few months now.
This MSSQL driver was release in July of 2016
Download the "SQLSRV40.EXE" from https://www.microsoft.com/en-us/download/details.aspx?id=20098
The executable is a self-extractor, unpack where you want.
You even get the PDO for the same price.
Here are the files in the package
PHP Drivers License Terms.rtf
php_pdo_sqlsrv_7_nts_x64.dll
php_pdo_sqlsrv_7_nts_x86.dll
php_pdo_sqlsrv_7_ts_x64.dll
php_pdo_sqlsrv_7_ts_x86.dll
php_sqlsrv_7_nts_x64.dll
php_sqlsrv_7_nts_x86.dll
php_sqlsrv_7_ts_x64.dll
php_sqlsrv_7_ts_x86.dll
release.txt
SQLSRV_Readme.htm
SQLSRV_ThirdPartyNotices.rtf
Tested with php 7.0, 7.1, 7.2

PHP 5.4 & MSSQL - Wampserver

I am trying to update my PHP, MSSQL functions to the newer ones which are supported by PHP 5.4. I have done everything and searched everywhere but I just can't get it to work.
I have installed WampServer 32 Bit to my C: drive and I have installed SQL drivers for PHP. I have made sure that the package I chose was 3.0 (http://www.microsoft.com/en-gb/download/details.aspx?id=20098) and I installed them correctly. I put the 'php_sqlsrv_54_ts.dll' into the ext folder which is in wamp/bin/php/ext and I added the 'extension=php_sqlsrv_54_ts.dll' to the php.ini file which is in wamp/bin/php.
Next I started all the services successfully and then went to my local host to find out that I was receiving this error:
Call to undefined function sqlsrv_connect() in C:\wamp\www\launcher\Login2.php on line 11
Further Information:
Running Windows 7 SP1 Ultimate 64 bit
Download Wamp Server 2 for 32 Bit
Apache : 2.4.4
MySQL : 5.6.12
PHP : 5.4.16
PHPMyAdmin : 4.0.4
SqlBuddy : 1.3.3
XDebug : 2.2.3
Running it on my localhost/127.0.0.1
Using port 8080 in Apache
Enabled pdo extensions in php.
Using the php_sqlsrv_54_ts.dll
Restarted Wamp several times.
I fixed it. I had previously gone into PHP extension via wamp server controls and ticked php_pdo_mssql and php_mssql but now that I have unchecked these I don't get the error anymore but rather a database connect fail. I am not familiar with the new sql server connections. Before I used mssql_connect with my host being as 'Farbod-PC\SQLExpress' I still use this host and it works fine.
after spending 7 hours on it, this was the answer to connect PHP 5.4 to MS SQL server.
edit: or just use php 5.3, as that has native php mssql connectors

Categories