• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Oci_connect error remote database

Erwan

Regular Pleskian
Server operating system version
Debian 11
Plesk version and microupdate number
18.0.42
Hi all,

We have a problem with extension OCI8 and the connexion to a remote database with oci_connect.

Configuration:
Plesk Obsedian 18.0.42
Debian 11
PHP FTM 7.4
Oci8

We thought it came from our firewall but after removing all iptables and ip6tables rules the problem is still here.
The remote network has successfully authorized the IP. When the same database is called from another server it works.

ModSecurity is off.
Fail2ban is off.

Do you have any idea of the possible origin of the problem?

1) fsockopen => ok. Port open
2) oci_connect => not ok. nothing with oci_error().
 
Port negociation pb?
but after removing all the iptables rules there should be no more problem...
 
hello @Erwan ,

do you see connection tries on DB side when trying oci_connect ? (tcpdump probably?)

do you see connection tries on Plesk side when trying oci_connect ? (tcpdump on plesk side ?)

what exactly error you receive?
is it connection error or it is authorization error from DB ?
 
Hello Nik,

I managed to retrieve information about the error. The problem seems to come from the installation of OCI8. I took the following psot:

oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries

The messages about this error are not clear: sometimes it is necessary to indicate them, sometimes precisely not to do so.
One way or the other, it doesn't matter. Always this error. the roads are good.

Note: we use instantclient_19_14:
# export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_14
# echo "export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_14" >> /etc/apache2/envvars
# echo "export ORACLE_HOME=/opt/oracle/instantclient_19_14" >> /etc/apache2/envvars
# echo "LD_LIBRARY_PATH=/opt/oracle/instantclient_19_14:$LD_LIBRARY_PATH" >> /etc/environment

If you have an idea... Thank you.
 
If I set the following variable:
# export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_14

An load the test with the command line, it works fine:
# /opt/plesk/php/7.4/bin/php test_oracle.php
==> ok

if I add the variable in "/etc/apache2/envvars" and "/etc/environment", it is not retrieved in the test launched via the domain.

# echo "export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_14" >> /etc/apache2/envvars
# echo "LD_LIBRARY_PATH=/opt/oracle/instantclient_19_14:$LD_LIBRARY_PATH" >> /etc/environment

Why?
 
I try to load Additionnel directives in Plesk PHP Settings:
[php-fpm-pool-settings]
env[LD_LIBRARY_PATH] = /opt/oracle/instantclient_19_14

But don't work...
 
The points-out that on systems running systemd, environment variables, such as LD_LIBRARY_PATH, are not necessarily propagated to processes that are started via a systemd Unit.
The only solution that works for me:

# cd /usr/lib/systemd/system/plesk-php74-fpm.service.d/
# vi environment.conf
with:
[Service]
Environment=LD_LIBRARY_PATH=/opt/oracle/instantclient_19_14
# systemctl daemon-reload
# systemctl restart plesk-php74-fpm
 
Back
Top