OCI8 php extension installation on windows server - php

I have specific problem with making OCI8 work on my server installation.
First setup:
Win 2008 Server 32bit
ZendServer for PHP with Apache2.2
PHP version 5.3.14 which was without php_oci8 files
No oracle things installed
I need to be able to connect to remote oracle database, so I find out, that OCI8 extension should be used. To make OCI8 work, I also should need at least Oracle Instant Client on server, because of certain DLL OCI8 need.
What I did?
downloaded Oracle Instant Client from their sites ( oracle download site ), version 11.2.0.4.0
unpacked into folder, I choosed Program Files/oci_11_2
added to windows variable path the address
restarted Win
downloaded php_oci8 libraries from PECL ( PECL oci8 dl site )
put them into the ext directory set in php.ini
added extension=php_oci8.dll into php.ini
restarted apache
After all this I checked php_info to see, if everything is ok, however no signs of oci8.
I tried older Oracle instant client, swtiching between php_oci8.dll, php_oci8_11g.dll or php_oci8_12c.dll, yet nothing helped.
I found, that due to php_info in environment section doesn't show the same values, as one that are set in windows.
From php error log I also got following:
[30-May-2014 08:02:16 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\Zend\ZendServer\lib\phpext\php_oci8_11g.dll' - The specified module could not be found.
in Unknown on line 0
Currently, I have no idea what to do, unless trying reinstalling php(which I don't want to because of many problematics connected with that), different Oracle instant clients or differenct php_oci8 libraries. I google for some hours, tried looking on Stack, but no solution, just some tips, that didn't help. Have someone encountered and solved something similar?

I have Same Issue, Following steps helped me out.
Download instantclient and place "C:\instantclient_11_2"
Set environment variable for C:\instantclient_11_2
Check your php version i.e. PHP Version 5.6.15
Form http://pecl.php.net/package/oci8 download exact version, for me its php_oci8-2.0.8-5.6-nts-vc11-x86.zip, unzip it and copy
php_oci8_11g.dll to php ext folder, for me its "C:\xampp\php\ext"
Un-Comment "extension=php_oci8_11g.dll" in php.ini and restart apache
check php_info(), oci8 should be enabled.
Thats all.

Related

How can I connect to an external (another server) Oracle Database using PHP? [duplicate]

I got this error.
Fatal error: Call to undefined function oci_connect()
$conn = oci_connect('localhost', 'username', 'password') or die(could not connect:'.oci_error)
that is the code.
This is the error I got.
Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\org\org\php\myphp.php on line 51
I checked the PHP DLL files in ext folder.
I just spend THREE WHOLE DAYS fighting against this issue.
I was using my ORACLE connection in Windows 7, and no problem. Last week I Just get a new computer with Windows 8. Install XAMPP 1.8.2. Every app PHP/MySQL on this server works fine. The problem came when I try to connect my php apps to Oracle DB.
Call to undefined function oci_pconnect()
And when I start/stop Apache with changes, a strange "Warning" on "PHP Startup" that goes to LOG with "PHP Warning: PHP Startup: in Unknown on line 0"
I did everything (uncommented php_oci8.dll and php_oci8_11g.dll, copy oci.dll to /ext directory, near /Apache and NOTHING it works. Download every version of Instant Client and NOTHING.
God came into my help. When I download ORACLE Instant Client 32 bits, everything works fine. phpinfo() displays oci8 info, and my app works fine.
So, NEVER MIND THAT YOUR WINDOWS VERSION BE x64. The link are between XAMPP and ORACLE Instant Client.
Simple steps
You need to enable the below extension in your php.ini
;extension=php_oci8.dll
;extension=php_oci8_11.g.dll
by removing the ";" so that the results will below:
extension=php_oci8.dll
extension=php_oci8_11.g.dll
Download Oracle Instant Client:- Preferably 32 bit. 32 bit will also work on 64 bit. You can just google: download oracle instant client windows 32 bit. Use version 11 of the client because extension=php_oci8_11.g.dll won't work with 12. Unzip the package into a location such as C:\Oracle\instantclient_11_2.
Finally modify the System's PATH Environment Variable with end location, under system variables not user variables
Then you need to restart the System for PATH changes to fully propagate.
If you just restart XAMPP/WAMP without restarting the machine the Client's DLL files (i.e. OCL.dll) will not be loaded (nor found)
by PHP's php_oci8_11g.dll extension.
You need to enable that extension in your php.ini file. See Oracle Installation:
extension=oci8.so
Things to Make sure
Whenever you connecting Oracle Database , try to use 32 Bit oracle client libraries, Since XAMP PHP is compiled with 32 Bit(Though you have 64 Bit windows Machine)
Download Oracle Client from Download From here
Paste it in C:\instantclient_12_1
Then Set the path to above in System Environment Variable
Then Go to C:\xampp\php\php.ini and uncomment extension=php_oci8_12c.dll
Then Restart the XAMP and it should work without any Issue.
I installed WAMPServer 2.5 (32-bit) and also encountered an oci_connect error. I also had Oracle 11g client (32-bit) installed. The common fix I read in other posts was to alter the php.ini file in your C:\wamp\bin\php\php5.5.12 directory, however this never worked for me. Maybe I misunderstood, but I found that if you alter the php.ini file in the C:\wamp\bin\apache\apache2.4.9 directory instead, you will get the results you want. The only thing I altered in the apache php.ini file was remove the semicolon to extension=php_oci8_11g.dll in order to enable it. I then restarted all the services and it now works! I hope this works for you.
Check your php –version as like as PHP 5.6.32 (cli) (built: Oct 25 2017 16:02:15).
Using the OCI8 extension to access Oracle Database. So Download php_oci8.dll from 1https://pecl.php.net/package/oci8/2.0.8/windows. (5.6 Thread Safe (TS) x86 ) php_oci8.dll must be the same version with your php version.Then unzipped it and you will find
1.php_oci8.dll
2.php_oci8_11g.dll (as per your oralce version) these two file pasted into your
(xampp\php\ext) folder.
Open your php.ini file and add these
extension=php_oci8.dll
extension=php_oci8_11g.dll
Check your oracle version and service name using these commands
Open your cmd
sqlplus / as sysdba
select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production, our oracle version is 11g so we can use instantclient_11_1 (Instant Client 32-bit) downloads from https://www.oracle.com/technetwork/topics/winsoft-085727.html
show parameter service_name;
service_name is orcl (you should remember this service name)
After downloading instantclient_11_1 unzipped it and then pasted in your Local Disk. And copy the path C:\instantclient_11_1 and then set this path as your user variable & system variable. Note is that my code is working without setting path variable.
Open your cmd and enter into SQL, create your schema following these commands
sqlplus / as sysdba
create user dbname identified by pass123;
grant connect,resource to dbname;
Create table user_info and insert data into your table and commit out.
Note: you must commit your data either data is not inserted.
Then this script run in your htdocs
<html>
<head><title>Oracle demo</title></head>
<body>
<?php
// Create connection to Oracle
$conn = oci_connect("dbname", "pass123", "//localhost/orcl"); // orcl is your service_name
$query = 'select * from user_info';
$stid = oci_parse($conn, $query);
$r = oci_execute($stid);
// Fetch each row in an associative array
print '<table border="1">';
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item !== null ? htmlentities($item, ENT_QUOTES) : '&nbsp').'</td>';
}
print '</tr>';
}
print '</table>';
I installed Wamp & expected everything to work out of the box. Not so.
I have 2 Oracle clients on my x64 Windows machine (instant and full). If anyone else has a similar setup, the trick is to make sure the instant client is (a) in your Path environment variable and (b) precedes the full client in the Path variable. There's a really brief section on Windows here but it gave the answer.
Alright, folks.
First, use
<?php
phpinfo();
?>
and determine your PHP Version (located at the very top, e.g. 7.0.xxx)
and also, your PHP Version architecture: x64 or x86
and also, Thread Safe or Not THread Safe (located in the first table as "Thread Safety".) "Disabled" obviously means "Not Thread Safe".
It is absolutely critical that the following three pieces of software that you will need are:
for the same major version of PHP (7.0 for 7.0.xxx)
same version of Oracle as the version you are accessing (11g, 12g, etc)
the same Not Thread Safe / Thread Safe version of PHP
all for the same architecture.
If any of the following are for a different architecture, Not Thread Safe/Thread Safe version, PHP major version number, or database version, you'll get errors:
1. PHP for Windows
2. OCI8 PECL Drivers for PHP (https://pecl.php.net/package/oci8)
3. Oracle Instant Client
Remember: If you are connecting to an 11g Oracle instance, you need an 11g driver.
Second, install the correct PHP, OCI8 PECL Driver, and instant client.
I chose:
d:\php\ for php
d:\oci\ for instant client
unzip the contents of the OCI8 PECL Driver into d:\php\ext\
Third, modify d:\php\php.ini according the instructions given by Oracle:
1. set the extension directory
2. set only one of the following:
a. for 11g drivers, use extension=php_oci8_11g.dll
b. for 12c drivers, use extension=php_oci8_12c.dll
c. for other oracle DB drivers, use the correct oracle extension.
Fourth: Add d:\oci\ (or whatever your instant client install location is) to your system PATH.
Fifth: reboot your PC.
Sixth, on a command prompt, type "where oci*" and verify that your Instant Client install path version of oci.dll is present.
Seventh, go to d:\php\ and type "php -m" and you should see OCI8 in the list.
If you do not see OCI8 in the list of modules after typing "php -m", open up d:\php\errorlog.txt
If you see something like:
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_oci8_11g.dll' - %1 is not a valid Win32 application.
then either instant client or your PECL driver download is not the same architecture as your PHP version.
If you see something like:
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_oci8_12c.dll' - The specified procedure could not be found.
then you are using the wrong OCI8 PECL driver for your version of instant client.
Hope this helps.
1 - The first step is to identify the right instant client for your xampp or wampp or lampp installation through checking PHP details from phpinfo. Create a simple php file and add the code below and preview on your browser.
<?php
phpinfo();
?>
phpinfo() details
2 - Go to https://www.oracle.com/database/technologies/instant-client/downloads.html and download the right instant client (base package and sdk) for your architecture (32bit or 64bit)
Instant client package - basic
Instant client package - SDK
3 - Extract instantclient to your preferred directory and add the path to your environment variables.
4 - Go to php.ini and enable oci8 extension by removing the ; at the start of the line.
Look for this line
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
Refactor to
extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
Environment variables
5 - Restart your PC
6 - Check your phpinfo (The page you created on step 1). You should see the details below:
OCI8
try this
in the php.ini file uncomment this
extension_dir = "./" "remove semicolon"
I had the same issue, the solution on this page helped me, it's caused by using incompatible oci ddl files.
Hope it helps.
Download xampp and uncomment oracle 12c extension or 11c 'extension=oci8_11g' for xampp 7.2.9
Download instant client 32 bit and set its path
Download instant client 32 bit SDK package and set its path
Copy instant clients and SDK dll files to xamp\php\ext, xampp\php\ and xampp\appache\bin\
Download php-oci of same php version of tread safe x86 then copy its files to php\ext*.dll,
php version is written on top of phpinfo tab of xampp admin.
OCI8 will appear on phpadmin page or apache admin then phpadmin tab. It means phpOCI has been installed.
Download from Instant Client for Microsoft Windows (x64) and extract the files below to "c:\oracle":
instantclient-basic-windows.x64-12.1.0.2.0.zip
instantclient-sqlplus-windows.x64-12.1.0.2.0.zip
instantclient-sdk-windows.x64-12.1.0.2.0.zip
This will create the following folder "C:\Oracle\instantclient_12_1".
Finally, add the "C:\Oracle\instantclient_12_1" folder to the PATH enviroment variable, placing it on the leftmost place.
Then Restart your server.

missing oci.dll and failed to load php_oci8.dll [duplicate]

I installed oracle 11g and I did create some tables and manipulate it using sql developer, and I am looking for a way to connect oracle with php on hosting site.
I tried but I get error after using this code:
$Conexion_ID =oci_connect($OracleUser, $OraclePassw, $OracleIP);
this is the error:
Call to undefined function oci_connect()
I've known that I should install and configure OCI8, so I downloaded this file:
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
but I don't know in which folder should I them to make the connection work well.
Download the PHP Extension from here(Confirm the PHP Version and download for the same, the thread safe[TS] version):
http://pecl.php.net/package/oci8/2.0.8/windows
You should be able to find three .dll's
php_oci8.dll, php_oci8_11g.dll and php_oci8_12c.dll
Place all dll's in extension directory, in WAMP it is generally wamp\bin\php\php5.*.*\ext
open the php configuration from the System try of wamp server and add the line:
; Enable only which is required
;extension=php_oci8.dll
extension=php_oci8_11g.dll
;extension=php_oci8_12c.dll
Restart the Apache server.
EDIT : Sorry I thought the other dll's are the libraries, but instead they are for different oracle versions. In your case enable 11g. Answer updated.
Update 2016-11-07: just wanted to say that latest package can be found here https://pecl.php.net/package/oci8. When I wrote this answer 2.0.8 was latest i guess.
if you are using wamp server on windows than you have to use the php_oci8.dll not the oci8.so. You need to download php_oci8.dll and copy it to ext directory under the PHP. If you don't have this extension in your PHP than install it and go to php.ini and add extension=php_oci8.dll.
Please make sure that wamp server have two php.ini files you have to change it on both the places. once everything is done than check with php info that oci 8 installed or not.

Cannot install Microsoft SQL driver for PHP 5.6 on Windows

I have been trying all day long and nothing. No sqlsrv extension, no logs, nothing. The sqlsrv_connect() function is not defined and I don't see the extension in phpinfo(). I tried WAMP at first. It didn't work. Now I am doing it bit by bit.
I have Windows 10
I installed SQL Express 2005 (is what I need for RMS).
I installed Apache 2.4.16 (x86) in C:\Apache\apache24 from here
I installed PHP 5.6.12 TS (x86) in C:\PHP\php5_6_12 from here
Configured Apache to load php5apache2_4.dll (and changed several other settings so it can run PHP files)
I downloaded Microsoft Drivers for PHP for SQL Server (file SQLSRV32.EXE) from here
I extracted php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll to the ext folder of PHP
Set up extension_dir like extension_dir = "ext"
Added the extensions to php.ini
I start Apache (httpd.exe), see no errors (neither inside the error.log file)
Now, when I open the file that outputs phpinfo() I don't see the extension anywhere. The sqlsrv_connect() is undefined.
I don't see where the PHP related errors are saved (maybe is not configured yet) and I am just stuck after trying thousands of solutions. Can't believe how hard is this in our century. PHP is really old but I really need to have this working.
print phpinfo() and and find sqlsrv. if you'r not able to find in phpinfo()
then, go to wamp and enable the extension my be you have not enable the extension , same issue happens with me so.. pls check
if you are using wamp with 64bit than you need to use unofficial Microsoft SQL Server Driver for PHP (sqlsrv)

Call to undefined function oci_connect()

I got this error.
Fatal error: Call to undefined function oci_connect()
$conn = oci_connect('localhost', 'username', 'password') or die(could not connect:'.oci_error)
that is the code.
This is the error I got.
Fatal error: Call to undefined function oci_connect() in C:\xampp\htdocs\org\org\php\myphp.php on line 51
I checked the PHP DLL files in ext folder.
I just spend THREE WHOLE DAYS fighting against this issue.
I was using my ORACLE connection in Windows 7, and no problem. Last week I Just get a new computer with Windows 8. Install XAMPP 1.8.2. Every app PHP/MySQL on this server works fine. The problem came when I try to connect my php apps to Oracle DB.
Call to undefined function oci_pconnect()
And when I start/stop Apache with changes, a strange "Warning" on "PHP Startup" that goes to LOG with "PHP Warning: PHP Startup: in Unknown on line 0"
I did everything (uncommented php_oci8.dll and php_oci8_11g.dll, copy oci.dll to /ext directory, near /Apache and NOTHING it works. Download every version of Instant Client and NOTHING.
God came into my help. When I download ORACLE Instant Client 32 bits, everything works fine. phpinfo() displays oci8 info, and my app works fine.
So, NEVER MIND THAT YOUR WINDOWS VERSION BE x64. The link are between XAMPP and ORACLE Instant Client.
Simple steps
You need to enable the below extension in your php.ini
;extension=php_oci8.dll
;extension=php_oci8_11.g.dll
by removing the ";" so that the results will below:
extension=php_oci8.dll
extension=php_oci8_11.g.dll
Download Oracle Instant Client:- Preferably 32 bit. 32 bit will also work on 64 bit. You can just google: download oracle instant client windows 32 bit. Use version 11 of the client because extension=php_oci8_11.g.dll won't work with 12. Unzip the package into a location such as C:\Oracle\instantclient_11_2.
Finally modify the System's PATH Environment Variable with end location, under system variables not user variables
Then you need to restart the System for PATH changes to fully propagate.
If you just restart XAMPP/WAMP without restarting the machine the Client's DLL files (i.e. OCL.dll) will not be loaded (nor found)
by PHP's php_oci8_11g.dll extension.
You need to enable that extension in your php.ini file. See Oracle Installation:
extension=oci8.so
Things to Make sure
Whenever you connecting Oracle Database , try to use 32 Bit oracle client libraries, Since XAMP PHP is compiled with 32 Bit(Though you have 64 Bit windows Machine)
Download Oracle Client from Download From here
Paste it in C:\instantclient_12_1
Then Set the path to above in System Environment Variable
Then Go to C:\xampp\php\php.ini and uncomment extension=php_oci8_12c.dll
Then Restart the XAMP and it should work without any Issue.
I installed WAMPServer 2.5 (32-bit) and also encountered an oci_connect error. I also had Oracle 11g client (32-bit) installed. The common fix I read in other posts was to alter the php.ini file in your C:\wamp\bin\php\php5.5.12 directory, however this never worked for me. Maybe I misunderstood, but I found that if you alter the php.ini file in the C:\wamp\bin\apache\apache2.4.9 directory instead, you will get the results you want. The only thing I altered in the apache php.ini file was remove the semicolon to extension=php_oci8_11g.dll in order to enable it. I then restarted all the services and it now works! I hope this works for you.
Check your php –version as like as PHP 5.6.32 (cli) (built: Oct 25 2017 16:02:15).
Using the OCI8 extension to access Oracle Database. So Download php_oci8.dll from 1https://pecl.php.net/package/oci8/2.0.8/windows. (5.6 Thread Safe (TS) x86 ) php_oci8.dll must be the same version with your php version.Then unzipped it and you will find
1.php_oci8.dll
2.php_oci8_11g.dll (as per your oralce version) these two file pasted into your
(xampp\php\ext) folder.
Open your php.ini file and add these
extension=php_oci8.dll
extension=php_oci8_11g.dll
Check your oracle version and service name using these commands
Open your cmd
sqlplus / as sysdba
select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production, our oracle version is 11g so we can use instantclient_11_1 (Instant Client 32-bit) downloads from https://www.oracle.com/technetwork/topics/winsoft-085727.html
show parameter service_name;
service_name is orcl (you should remember this service name)
After downloading instantclient_11_1 unzipped it and then pasted in your Local Disk. And copy the path C:\instantclient_11_1 and then set this path as your user variable & system variable. Note is that my code is working without setting path variable.
Open your cmd and enter into SQL, create your schema following these commands
sqlplus / as sysdba
create user dbname identified by pass123;
grant connect,resource to dbname;
Create table user_info and insert data into your table and commit out.
Note: you must commit your data either data is not inserted.
Then this script run in your htdocs
<html>
<head><title>Oracle demo</title></head>
<body>
<?php
// Create connection to Oracle
$conn = oci_connect("dbname", "pass123", "//localhost/orcl"); // orcl is your service_name
$query = 'select * from user_info';
$stid = oci_parse($conn, $query);
$r = oci_execute($stid);
// Fetch each row in an associative array
print '<table border="1">';
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item !== null ? htmlentities($item, ENT_QUOTES) : '&nbsp').'</td>';
}
print '</tr>';
}
print '</table>';
I installed Wamp & expected everything to work out of the box. Not so.
I have 2 Oracle clients on my x64 Windows machine (instant and full). If anyone else has a similar setup, the trick is to make sure the instant client is (a) in your Path environment variable and (b) precedes the full client in the Path variable. There's a really brief section on Windows here but it gave the answer.
Alright, folks.
First, use
<?php
phpinfo();
?>
and determine your PHP Version (located at the very top, e.g. 7.0.xxx)
and also, your PHP Version architecture: x64 or x86
and also, Thread Safe or Not THread Safe (located in the first table as "Thread Safety".) "Disabled" obviously means "Not Thread Safe".
It is absolutely critical that the following three pieces of software that you will need are:
for the same major version of PHP (7.0 for 7.0.xxx)
same version of Oracle as the version you are accessing (11g, 12g, etc)
the same Not Thread Safe / Thread Safe version of PHP
all for the same architecture.
If any of the following are for a different architecture, Not Thread Safe/Thread Safe version, PHP major version number, or database version, you'll get errors:
1. PHP for Windows
2. OCI8 PECL Drivers for PHP (https://pecl.php.net/package/oci8)
3. Oracle Instant Client
Remember: If you are connecting to an 11g Oracle instance, you need an 11g driver.
Second, install the correct PHP, OCI8 PECL Driver, and instant client.
I chose:
d:\php\ for php
d:\oci\ for instant client
unzip the contents of the OCI8 PECL Driver into d:\php\ext\
Third, modify d:\php\php.ini according the instructions given by Oracle:
1. set the extension directory
2. set only one of the following:
a. for 11g drivers, use extension=php_oci8_11g.dll
b. for 12c drivers, use extension=php_oci8_12c.dll
c. for other oracle DB drivers, use the correct oracle extension.
Fourth: Add d:\oci\ (or whatever your instant client install location is) to your system PATH.
Fifth: reboot your PC.
Sixth, on a command prompt, type "where oci*" and verify that your Instant Client install path version of oci.dll is present.
Seventh, go to d:\php\ and type "php -m" and you should see OCI8 in the list.
If you do not see OCI8 in the list of modules after typing "php -m", open up d:\php\errorlog.txt
If you see something like:
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_oci8_11g.dll' - %1 is not a valid Win32 application.
then either instant client or your PECL driver download is not the same architecture as your PHP version.
If you see something like:
PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_oci8_12c.dll' - The specified procedure could not be found.
then you are using the wrong OCI8 PECL driver for your version of instant client.
Hope this helps.
1 - The first step is to identify the right instant client for your xampp or wampp or lampp installation through checking PHP details from phpinfo. Create a simple php file and add the code below and preview on your browser.
<?php
phpinfo();
?>
phpinfo() details
2 - Go to https://www.oracle.com/database/technologies/instant-client/downloads.html and download the right instant client (base package and sdk) for your architecture (32bit or 64bit)
Instant client package - basic
Instant client package - SDK
3 - Extract instantclient to your preferred directory and add the path to your environment variables.
4 - Go to php.ini and enable oci8 extension by removing the ; at the start of the line.
Look for this line
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
Refactor to
extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
Environment variables
5 - Restart your PC
6 - Check your phpinfo (The page you created on step 1). You should see the details below:
OCI8
try this
in the php.ini file uncomment this
extension_dir = "./" "remove semicolon"
I had the same issue, the solution on this page helped me, it's caused by using incompatible oci ddl files.
Hope it helps.
Download xampp and uncomment oracle 12c extension or 11c 'extension=oci8_11g' for xampp 7.2.9
Download instant client 32 bit and set its path
Download instant client 32 bit SDK package and set its path
Copy instant clients and SDK dll files to xamp\php\ext, xampp\php\ and xampp\appache\bin\
Download php-oci of same php version of tread safe x86 then copy its files to php\ext*.dll,
php version is written on top of phpinfo tab of xampp admin.
OCI8 will appear on phpadmin page or apache admin then phpadmin tab. It means phpOCI has been installed.
Download from Instant Client for Microsoft Windows (x64) and extract the files below to "c:\oracle":
instantclient-basic-windows.x64-12.1.0.2.0.zip
instantclient-sqlplus-windows.x64-12.1.0.2.0.zip
instantclient-sdk-windows.x64-12.1.0.2.0.zip
This will create the following folder "C:\Oracle\instantclient_12_1".
Finally, add the "C:\Oracle\instantclient_12_1" folder to the PATH enviroment variable, placing it on the leftmost place.
Then Restart your server.

How to fix sqlsrv in info.php?

I am using
Ultimate goal: To install wordpress in IIS with MSSQL as DB backend (sqlsrvmethod)
Primary Objective: info.php doesn't shows, "slqsrv".
So trying to install that extension or directive into php. Configuration as below,
Web server - IIS,
mssql driver 3.0,
sqlsrv NOT PDO,
PHP version 5.4.3 (PHP-CGI.exe is being used from D: loaded which is present in wamp/bin/php/php.5.4.3. Since couldn't get any php-cgi.exe along with php file from php.net)
MSSQL 2008
Thread Safety - Enabled, can't able to download php_sqlsrv_54_nts.dll or php_pdo_sqlsrv_54_nts.dll.
Ended up with below, PHP Warning: PHP Startup: Unable to load dynamic library 'D:\wamp\bin\php\php5.4.3\ext\php_sqlsrv_53_ts.dll' - The specified module could not be found.
The php must be installed in the default location of C: drive. Then point it in IIS using PHP manager.
The SQLSRV.v.3.0 must be installed in default location C:
These helped me to resolve the issue easier.
First you must have:
extension=php_sqlsrv_54_ts.dll
extension=php_pdo_sqlsrv_54_ts.dll
in your php.ini file, and both above mentioned drivers must be in "ext" folder of php and you must restart your apache or iis server, then it should show as you expected.....

Categories