php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75695 LDAP & OpenSSL Libdir Compile Bug
Submitted: 2017-12-15 23:57 UTC Modified: 2021-11-07 04:22 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: me at nbishop dot name Assigned: cmb (profile)
Status: No Feedback Package: Compile Failure
PHP Version: 7.1.12 OS: Linux (Fedora)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-12-15 23:57 UTC] 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.


Patches

ldap-openssl-libdir.patch (last revision 2017-12-16 00:02 UTC by me at nbishop dot name)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-27 11:50 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-10-27 11:50 UTC] cmb@php.net
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>
 [2021-11-07 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jan 29 09:03:44 2023 UTC