Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PHP Startup Unable to load dynamic library '/usr/lib/php/20151012/oci8.so' - libmql1.so: cannot open

user10068859Jul 21 2017 — edited Jul 21 2017

Hi

I've tried to install Oracle in a clean Ubuntu Server 17.04 following the steps from lots of tutorials, and still have "half succeeded"

  • Downloaded rpms from latest basic client / sdk / sqlplus
  • Installed php7.0 php.7.0-dev libaio1 build-essential
  • Converted rpm using alien, installed all of them with dpkg -i, first base, then sdk, then sqlpus
  • Downloaded manually oci8 from pecl.php.net (as you can see i have a very restricted proxy which does not allow me to go pecl.php.net
  • Untarred. phpize
  • ./configure --with-oci8=shared,instantclient,/usr/lib/oracle/12.2/client64/lib
  • make. then sudo make install

     Library was installed to /usr/lib/php/20151012/oci8.so

  • Added variables to /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/administrador/oracle/oci8-2.1.4/modules:/usr/lib/oracle/12.2/client64:/usr/lib/oracle/12.2/client64/lib"

LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib

ORACLE_HOME=/usr/lib/oracle/12.2/client64

http_proxy="http://1.2.3.4:56"

https_proxy="http://1.2.3.4:56"

  • Added "extension=/usr/lib/php/20151012/oci8.so" w/o quotes, to both files, /etc/php/7.0/apache2/php.ini and /etc/php/7.0/cli/php.ini
  • Rebooted Server
  • Tried in command line:
    • php --ri oci8

oci8

OCI8 Support => enabled

OCI8 DTrace Support => disabled

OCI8 Version => 2.1.4

Revision => $Id: 03698b2e9b50593039b7ca292b2e3cf9eaf064b9 $

Oracle Run-time Client Library Version => 12.2.0.1.0

Oracle Compile-time Instant Client Version => 12.2

Directive => Local Value => Master Value

oci8.max_persistent => -1 => -1

oci8.persistent_timeout => -1 => -1

oci8.ping_interval => 60 => 60

oci8.privileged_connect => Off => Off

oci8.statement_cache_size => 20 => 20

oci8.default_prefetch => 100 => 100

oci8.old_oci_close_semantics => Off => Off

oci8.connection_class => no value => no value

oci8.events => Off => Off

Statistics => 

Active Persistent Connections => 0

Active Connections => 0

  • Then tried from terminal: php /var/www/html/oracle.php

     All went fine. Test connection worked

The problem is that when I try from browser

http://myserverip/oracle.php

Page can't load

When I see apache2 error log in /var/log/apache2/error.log I see

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/oci8.so' - libmql1.so: cannot open shared object file: No such file or directory in Unknown on line 0

I don't know how to fix. The file exists in /usr/lib/oracle/12.2/client64/lib/libmql1.so and lists with -rw-rwxr-- 1 root root 539065 ene 26 10:14 libmql1.so

Maybe a permissions problem? I think I don't have selinux enabled

Maybe a paths problem?

As stated, php cli works great with oracle, no errors, etc. but phpinfo() and web don't work. phpinfo() does not show of course because apache could not load oci8.so

I've installed both php7 and php7-dev packages because 1) php7 is needed for apache to work with php files and 2) php-dev contains tools to compile pecl oci8

Thanks a lot

This post has been answered by Nik on Jul 21 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2017
Added on Jul 21 2017
2 comments
4,303 views