Monday, March 7, 2022

[FIXED] php oci8 module not loaded (ubuntu 16)

Issue

I have a problem with the oci8 module, it doesn't load.

The OS is Ubuntu 16, with Apache 2.4 and PHP 5.6

I do the following steps:

  • I Downloaded Oracle Instant Client Basic and SDK packages: ( oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm, oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm )
  • Installed the Oracle Instant Client (after converting the .rpm to .deb)
  • Downloaded the OCI8 Extension from PECL ( oci8-2.0.12 )
  • Built the PHP OCI8 Module
  • Copied oci8.so to modules directory (/usr/lib/php/20131226/)
  • Edited php.ini file and adding extension with full path (extension=/usr/lib/php/20131226/oci8.so)
  • Added the oracle library path to the environment variable LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib
  • Then, Restarted Apache web server

The module is not loaded and Apache logs show the following error:

Unable to load dynamic library '/usr/lib/php/20131226/oci8.so' - libaio.so.1: cannot open shared object file: No such file or directory in Unknown on line 0


Solution

The problem was from libaio.so library as @Alexandre mentioned, It's a 32/64 bit mismatch.

I found the problem from @Codo answer: https://stackoverflow.com/a/10619763/1995358

The problem solved after installing libaio.so library again:

sudo apt-get install libaio1



Answered By - Ahmad Abdullah

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.