-1

Has anyone ever come across this error when upgrading to php 7.2.34 ?

It seems to be an error while running a php script under a user directory but for the life of me i can't find a solution yet.

I'm assuming (not super great with linux) that it's an issue with the local user account pointing to the wrong spot on the server.

It's looking in here "/usr/lib64/php/modules/oci8" Which does not exist, but "/usr/lib64/php/modules" contains all the .so files from what i can tell.

This was a complete uninstall of the original php 7.0 and upgrade to 7.2

Error

php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'oci8' (tried: /usr/lib64/php/modules/oci8 (/usr/lib64/php/modules/oci8: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so (libclntsh.so.19.1: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: /usr/lib64/php/modules/pdo_oci (/usr/lib64/php/modules/pdo_oci: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo_oci.so (libclntsh.so.19.1: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'oci8.so' (tried: /usr/lib64/php/modules/oci8.so (libclntsh.so.19.1: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so.so (/usr/lib64/php/modules/oci8.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.2.34 (cli) (built: Jan  4 2021 14:20:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.34, Copyright (c) 1999-2018, by Zend Technologies

Contents of ls -l /usr/lib64/php/modules

bcmath.so
bz2.so
calendar.so
ctype.so
curl.so
dom.so
exif.so
fileinfo.so
ftp.so
gd.so
gettext.so
iconv.so
intl.so
json.so
ldap.so
mbstring.so
mcrypt.so
mysqli.so
mysqlnd.so
oci8.so
opcache.so
pdo_mysql.so
pdo_oci.so
pdo.so
pdo_sqlite.so
phar.so
posix.so
shmop.so
simplexml.so
sockets.so
sqlite3.so
sysvmsg.so
sysvsem.so
sysvshm.so
tokenizer.so
wddx.so
xmlreader.so
xml.so
xmlwriter.so
xsl.so

Any helps appreciated.

Rob
  • 153
  • 1
  • 3
  • 14

1 Answers1

0

Assuming your database is on a remote computer, then install Oracle Instant Client (64-bit is here) on the computer running PHP and use the ldconfig method of setting the system library search path. This is shown in the install instructions at the foot of the page. Also make sure the libaio (or libaio1 packge on Debian/Ubuntu) is installed.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48
  • Looks like i got it installed and working via CLI. Right now, it seems like the web interface doesn't work and keeps tossing the error -> Attempted to call function "oci_connect". I can run it via cli under the same username the web server runs on. Do you by chance have any suggestions on what to start looking into for that issue? So far my google fu is lacking. – Rob Jan 19 '21 at 06:36
  • If you are using Oracle Instant Client, then use ldconfig (as shown in install instructions) to set the system-wide library search path. I expect PHP works in command line because you have LD_LIBRARY_PATH set. You could work out how to set LD_LIBRARY_PATH for Apache, but it is much easier to use ldconfig. (And don't forget to restart Apache) – Christopher Jones Jan 19 '21 at 07:06
  • Thanks, So, i installed instantclient 21.1, Not sure if that was causing issues or something stupid. It would not work with the ldconfig steps. sudo sh -c "echo /opt/oracle/instantclient_21 > \ /etc/ld.so.conf.d/oracle-instantclient.conf" It worked hard coding that into my scripts or setting the environment variables for the system. Finally added it to the httpd config file and restarted apache and it works on the web now. (/etc/sysconfig/httpd -> LD_LIBRARY_PATH=/opt/oracle/instantclient_21_1). Not 100% sure if that's the correct way to do it or not? It seems to work on both. – Rob Jan 19 '21 at 14:47
  • Do you think it should be safe leaving it setup like that? Or is there something i may have missed you think during install? (Assuming i followed the steps at the botom of the page, but changed it to version 21. https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html – Rob Jan 19 '21 at 14:48
  • You haven't given enough detail e.g about whether you used RPMs or ZIPs, and I don't know your error or what "would not work" for me to comment on best practice, but updating sysconfig/httpd is generally fine. – Christopher Jones Jan 19 '21 at 22:31