• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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