Skip to content

--libdir option default value #18579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
remicollet opened this issue May 17, 2025 · 4 comments
Open

--libdir option default value #18579

remicollet opened this issue May 17, 2025 · 4 comments

Comments

@remicollet
Copy link
Member

remicollet commented May 17, 2025

Description

For years we use (for RPM build)

--libdir=/usr/lib64/php

excepted for embed SAPI which need the default path

--libdir=/usr/lib64

Since 0c07b0d this should not be necessary thanks to orig_libdir used for embded

orig_libdir=$libdir
AS_CASE([$libdir],
  ['${exec_prefix}/lib'], [libdir=$libdir/php])

AS_CASE([$(eval echo $datadir)],
  ['${prefix}/share'], [datadir=$datadir/php])

But the test does not work because of quote.

A proper test is probably (no quote + using php_libdir for lib64 case)

AS_CASE([$libdir],
  [${prefix}/${PHP_LIBDIR}], [libdir=$libdir/php])

Same issue with datadir, but this is only used for fpm/status.html page, other use datarootdir. Perhaps we can drop this check (to avoid change)

Help welcome on this

PHP Version

In PHP-8.4

Operating System

Linux

@remicollet
Copy link
Member Author

ping @adsr for 0c07b0d
ping @petk for db9a7aa

remicollet added a commit to remicollet/php-src that referenced this issue May 19, 2025
Using PHP_LIBDIR for lib64 case
Fix AS_CASE for libdir and datadir broken by quotes
@remicollet
Copy link
Member Author

Fix proposal in PR #18596 only to master to avoid file placement in stable release
(in some build, FPM status page will move from /usr/share/fpm to /usr/share/php/fpm)

@petk
Copy link
Member

petk commented May 27, 2025

I think this would need a bit more fine tuning. Can you explain again what is actually the issue here? You'd want to build this like

./configure --with-libdir=lib64

and have libdir automatically set to /usr/lib64/php, or, you'd want to specify lib directory and PHP's lib directory each separately?

These library directories fall into so called GNU standards special cases. When /usr prefix is used, the library directory should become /usr/lib64 on some platforms, and /usr/lib/x86_64-linux-gnu on some others, and /usr/lib on some more GNU-default-alike platforms.

If you ask me, these installation directories are almost always simplest to manage manually per-platform basis in any build system. What PHP should do here is go more into configuring something like a library subdirectory name (with default being php) so the extensions are installed somewhere into <lib-dir>/php, and libphp into <lib-dir>. And this library subdirectory can be customized to something like php/8.5 for different PHP versions installed. About embed library, yes probably should also have it customizable somehow so libphp for 8.5 and 8.4 can be installed at the same time.

What current condition here does is simply appending the php to the default paths (Autoconf sets it to a literal ${exec_prefix}/lib) which can mess things up indeed. And if I'm not mistaken, some builds even use literal arguments like this:

./configure --libdir='${exec_prefix}/lib64/php'

@remicollet
Copy link
Member Author

remicollet commented May 28, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants