Bug #75695 [Opn->Fbk]: LDAP & OpenSSL Libdir Compile Bug

From: Date: Wed, 27 Oct 2021 11:50:27 +0000
Subject: Bug #75695 [Opn->Fbk]: LDAP & OpenSSL Libdir Compile Bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237398@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75695&edit=1 ID: 75695 Updated by: cmb@php.net Reported by: me at nbishop dot name Summary: LDAP & OpenSSL Libdir Compile Bug -Status: Open +Status: Feedback Type: Bug Package: Compile Failure Operating System: Linux (Fedora) PHP Version: 7.1.12 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Is this still an issue with any of the actively supported PHP versions[1]? AFAIK, openssl relies on pkg-config as of PHP 7.4.0, and ldap should do that as well, instead of manually fiddling with the paths. [1] <https://www.php.net/supported-versions.php> Previous Comments: ------------------------------------------------------------------------ [2017-12-15 23:57:20] me at nbishop dot name Description: ------------ This started out at first as just a bug with compiling PHP w/ a compiled OpenSSL but has since turned into what looks like some configure oddities with the way --with-libdir values are attempted to be used. 1) When trying to use a compiled OpenSSL (not-packaged), PHP attempts to use a weird combination of $PHP_OPENSSL_DIR/$PHP_LIB_DIR (see line 2369 of acinclude.m4). What it should likely be doing is using $PHP_LIB_DIR alone as defined by --with-libdir. An alternative solution would be to restore the old --with-openssl-libs switch that existed < PHP7 versions. 2) When trying to implement ldap support (--with-ldap), another issue is encountered relative to --with-libdir. If no directory is specified with the ldap switch, then it appears to try and use a hardcoded reference of /usr/$PHP_LIB_DIR which results in it looking literally in /usr//usr/local/lib64 for example. Unfortunately specifying a directory does not really resolve it, with the openldap package it installs to /usr/lib64, so specifying --with-ldap=/usr/lib64 causes it to be unable to see the required headers (under /usr/local), and obviously using /usr/local as the path lets it see the headers but not the actual libs. As far as I can tell these issues are present from the start of PHP 7.0 to the current 7.2 code branch and likely would impact any linux distro environment. There may also be other ones, I did not test -all- switches, just the ones I needed in this case. I've attached a patch file that 'quick-fixes' the relevant .m4 conf files (and passed make test). The OpenSSL section is fairly straight forward imo, but I likely made a mess of the LDAP attempt so anyone wants to critique and improve that one please do lol. If the patch file looks okay to others, I'll do a pull request on github. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75695&edit=1

« previous php.bugs (#237398) next »