|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80926 Unable to compile PDO_OCI and LDAP
Submitted: 2021-04-01 08:23 UTC Modified: 2021-04-20 01:46 UTC
From: tmp6 at turnov dot org Assigned: mcmic (profile)
Status: Re-Opened Package: Compile Failure
PHP Version: 8.0.3 OS: Ubuntu 18.04.5 LTS
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-04-01 08:23 UTC] tmp6 at turnov dot org
It's unable to compile LDAP and PDO oci together.

/bin/bash /usr/local/src/php-8.0.3/libtool --silent --preserve-dup-deps --mode=compile cc -Imain/ -I/usr/local/src/php-8.0.3/main/ -I/usr/local/src/php-8.0.3/include -I/usr/local/src/php-8.0.3/main -I/usr/local/src/php-8.0.3 -I/usr/local/src/php-8.0.3/ext/date/lib -I/usr/include/libxml2 -I/usr/local/include/oracle/21.1/client64 -I/usr/local/src/php-8.0.3/TSRM -I/usr/local/src/php-8.0.3/Zend    -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c main/internal_functions_cli.c -o main/internal_functions_cli.lo 
In file included from /usr/local/src/php-8.0.3/ext/ldap/php_ldap.h:26:0,
                 from main/internal_functions_cli.c:37:
/usr/local/include/oracle/21.1/client64/ldap.h:48:0: warning: "LBER_CLASS_UNIVERSAL" redefined


In file included from /usr/local/src/php-8.0.3/ext/ldap/php_ldap.h:23:0,
                 from main/internal_functions_cli.c:37:
/usr/include/lber.h:335:1: note: previous declaration of ‘ber_scanf’ was here
 ber_scanf LDAP_P((
Makefile:1222: recipe for target 'main/internal_functions_cli.lo' failed
make: *** [main/internal_functions_cli.lo] Error 1

Test script:
./configure \
--prefix=/opt/php-$PHPVER \
--with-config-file-path=/opt/php-$PHPVER/etc \
--with-config-file-scan-dir=/opt/php-$PHPVER/etc/conf.d \
--with-pdo-oci=shared,instantclient,/usr/local/lib/oracle/21.1/client64/lib \


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-06 08:55 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-04-06 08:55 UTC]
If you want to build both LDAP and OCI, you need to use the Oracle
LDAP libraries, i.e. you need to pass the path to configure;
something like:

  ./configure --with-ldap=/usr/lib/oracle/21.1/client64/lib …
 [2021-04-06 15:25 UTC] tmp6 at turnov dot org
Not possible to use current ldap libraries from Oracle

/bin/bash /usr/local/src/php-8.0.3/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/ldap/ -I/usr/local/src/php-8.0.3/ext/ldap/ -I/usr/local/src/php-8.0.3/include -I/usr/local/src/php-8.0.3/main -I/usr/local/src/php-8.0.3 -I/usr/local/src/php-8.0.3/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/local/lib/oracle/21.1/client64/include -I/usr/local/include -I/usr/local/src/php-8.0.3/ext/mbstring/libmbfl -I/usr/local/src/php-8.0.3/ext/mbstring/libmbfl/mbfl -I/usr/local/include/oracle/21.1/client64 -I/usr/lib/x86_64-linux-gnu/libzip/include -I/usr/local/src/php-8.0.3/TSRM -I/usr/local/src/php-8.0.3/Zend    -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/local/src/php-8.0.3/ext/ldap/ldap.c -o ext/ldap/ldap.lo 
/usr/local/src/php-8.0.3/ext/ldap/ldap.c: In function ‘_close_ldap_link’:
/usr/local/src/php-8.0.3/ext/ldap/ldap.c:104:2: warning: implicit declaration of function ‘ldap_destroy’; did you mean ‘ldap_perror’? [-Wimplicit-function-declaration]
/usr/local/src/php-8.0.3/ext/ldap/ldap.c: In function ‘_php_ldap_control_to_array’:
/usr/local/src/php-8.0.3/ext/ldap/ldap.c:147:30: error: ‘LDAP_CONTROL_PASSWORDPOLICYRESPONSE’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_PWDEXPIRING’?
  if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) == 0) {

 [2021-04-06 16:12 UTC]
-Status: Not a bug +Status: Re-Opened -Assigned To: cmb +Assigned To: mcmic
 [2021-04-06 16:12 UTC]
> Not possible to use current ldap libraries from Oracle

Oh!  Côme might be interested in this.

At least as workaround, you can likely build PHP without PDO_OCI
first, and then do a phpize build of PDO_OCI.
 [2021-04-08 08:13 UTC]
If I understand correctly Oracle LDAP libraries have no ldap_destroy function.

This function is called since commit 80958d0f90dfa9a48e92e81e027121ec091c9d03

Can you try replacing ldap_destroy by ldap_unbind_ext and see if this fixes compilation? If so we may add an ifdef block to do this for oracle lib.

But building php-ldap with another lib than openldap will remove some features and is not thoroughly tested.

In your case it seems an other solution would be to use openldap lib anyway but the problem is the ldap.h from oracle gets pulled into path and is selected. I’m not sure how you can force the openldap one instead.
 [2021-04-20 01:46 UTC]
-Summary: Unable to compile PDO oci and LDAP +Summary: Unable to compile PDO_OCI and LDAP
 [2021-04-20 01:46 UTC]
Try building in two stages: build without PDO_OCI, and then do a separate build to create
 [2022-08-19 20:01 UTC] hammesmatthias0 at yahoo dot com
The following pull request has been associated:

Patch Name: change php version and copyright year
On GitHub:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 20:01:39 2024 UTC