Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

oracle - Error loading oci8.so with Ubuntu server 17.04 php 7 and apache2

I have gone through the whole process of downloading Oracle instant client, SDK, etc. in a Ubuntu Server 17.04. Then converted rpm packages to deb with alien, installed, set the paths, downloaded pecl oci8, compiled and installed (w/o errors), etc. and then added the line:

extension=/usr/lib/php/20151012/oci8.so

And restarted. When I check the /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
[Thu Jul 20 10:46:44.352631 2017] [mpm_prefork:notice] [pid 23450] AH00163: Apache/2.4.25 (Ubuntu) configured -- resuming normal operations
[Thu Jul 20 10:46:44.352717 2017] [core:notice] [pid 23450] AH00094: Command line: '/usr/sbin/apache2'

Does any one know what I could do to make it work? I guess I have not selinux enabled or maybe it is a permissions problem?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The solution is to put the ORACLE global variables NOT in /etc/environment but in the /etc/apache2/envvars

So, I've added these 2 lines at the end of /etc/apache2/envvars

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

And all working great


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.5k users

...