• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • 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.

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