4

we face a big problem to connect oracle server in php What i done

  • Setp 1:

    Install Windows 7 32bit

  • Step 2 :

    install XAMPP 32 ( Includes: Apache 2.4.29, PHP 7.1.11, phpMyAdmin 4.7.4, OpenSSL 1.0.2, XAMPP Control Panel 3.2.2)

  • Step :

    Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications Download instantclient-basic-nt-12.2.0.1.0.zip and extract it into c drive with instantclient_12_2 name

  • Step 5:

    Set environment in path "c:\instantclient_12_2"

  • Step 6:

    Edit php.ini file and enable extension=php_oci8_12c.dll (By removing semicolon ) from front

  • Step 7 :

    Restart my apache server , after that when i check phpinfo() it not showing any oci8 module

Then i check my error log i see this

[30-Nov-2017 13:42:43 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_oci8_12c.dll' - The specified procedure could not be found.

Can any one help me how to resolve this issue ,

Thanks in advance , and sorry for my English.

Md Hasibur Rahaman
  • 1,041
  • 3
  • 11
  • 34

2 Answers2

6

On the Instant Client download page, the next line after the download link for instantclient-basic-nt-12.2.0.1.0.zip states:

The 12.2 Basic package requires the Microsoft Visual Studio 2013 Redistributable.

As you haven't listed that in what you've tried, installing it should be your next step.

You should also reboot to ensure that your changes to the environment PATH are applied system wide (e.g. to the Apache service).

timclutton
  • 12,682
  • 3
  • 33
  • 43
  • Thank you , You save my lot of time :) – Md Hasibur Rahaman Dec 02 '17 at 05:53
  • I have done above-mentioned steps and also installed Redistributable but I have received the warning and oracle connection, not setup. `$ php --ri oci8 PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_ oci8_12c.dll' - The specified module could not be found. in Unknown on line 0` – Waqas Mehmood Apr 25 '18 at 05:23
  • @WaqasMehmood Try a more [comprehensive answer](https://stackoverflow.com/a/49873791/3775731). – timclutton Apr 25 '18 at 05:54
  • I have followed all 7 steps mentioned by @MdHasiburRahaman and also installed Microsoft visual studio Redistributable and `php_oci8_12c.dll` file placed inside the `php\ext` folder but still I am unable to connect with database and receiving these warning `PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_oci8_12c.dll' - The specified module could not be found. in Unknown on line 0` and `Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_oci8_12c.dll' - The specified module could not be found. in Unknown on line 0` – Waqas Mehmood Apr 26 '18 at 03:33
  • I've also faced the issue while using PHP code sniffer using command line. I've tried many solutions but nothing was helpful. but today I realized that when I've installed the code sniffer at that time the PHP ( C:\xampp\php ) path in the system environment is different and now I'm running the PHP ( F:\xampp\php ) with different path. So I've changed the system environment variable path and now the error is resolved. – Munshi Azhar Jun 24 '20 at 17:46
2

I've come with a solution.

copy oci.dll, oraociei12.dll, and oraons.dll to apache/bin folder and replace the existing one.

Pavel Smirnov
  • 4,611
  • 3
  • 18
  • 28
Ravikumar
  • 29
  • 1