Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 624528 - app-eselect/eselect-php - /etc/init.d/php-fpm fails when PHP installed under /usr/lib64
Summary: app-eselect/eselect-php - /etc/init.d/php-fpm fails when PHP installed under ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-11 06:50 UTC by Rich Alimi
Modified: 2017-07-28 20:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.txt,5.28 KB, text/plain)
2017-07-11 06:50 UTC, Rich Alimi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rich Alimi 2017-07-11 06:50:46 UTC
Created attachment 482984 [details]
emerge --info

I've installed Gentoo on an arm64 machine (Raspberry Pi 3). PHP is installed under /usr/lib64 on this machine:

$ ls -ld /usr/lib*/php7*
drwxr-xr-x 7 root root 4096 Jul  8 18:33 /usr/lib64/php7.0


However, /etc/init.d/php-fpm assumes that PHP is installed under /usr/lib instead of /usr/lib64.

Specifically, it contains this line:
  PHP_FPM_BIN="/usr/lib/${PHPSLOT}/bin/php-fpm"

This causes /etc/init.d/php-fpm to fail to start.

Patching this locally to be:
  PHP_FPM_BIN="/usr/lib64/${PHPSLOT}/bin/php-fpm"
solves the problem.
Comment 1 Michael Orlitzky gentoo-dev 2017-07-11 17:00:01 UTC
We can probably fix this by passing --libdir=$(get_libdir) explicitly in the eselect-php ebuild, but I think you should have a symlink /usr/lib -> /usr/lib64 anyway. Do you have /usr/lib at all? If so, where does it point?

The reason it should be there is that most autotools packages default to something like

  --libdir=DIR            object code libraries [EPREFIX/lib]

and without the symlink, we would need to add a lot of extra --libdir parameters everywhere.
Comment 2 Brian Evans (RETIRED) gentoo-dev 2017-07-11 18:32:20 UTC
(In reply to Michael Orlitzky from comment #1)
> We can probably fix this by passing --libdir=$(get_libdir) explicitly in the
> eselect-php ebuild, but I think you should have a symlink /usr/lib ->
> /usr/lib64 anyway. Do you have /usr/lib at all? If so, where does it point?
> 
> The reason it should be there is that most autotools packages default to
> something like
> 
>   --libdir=DIR            object code libraries [EPREFIX/lib]
> 
> and without the symlink, we would need to add a lot of extra --libdir
> parameters everywhere.

I've put a commit in the eselect-php repo to fix this, but the autotools magic is not quite right. (I have to delete the resulting file which is installed by the Makefile.)

And we shouldn't count on the symlink, there are plans are to remove it, see bug 506276
Comment 3 Rich Alimi 2017-07-12 06:08:37 UTC
Thank you for such a fast response!
Comment 4 Michael Orlitzky gentoo-dev 2017-07-19 14:13:16 UTC
(In reply to Brian Evans from comment #2)
> 
> I've put a commit in the eselect-php repo to fix this, but the autotools
> magic is not quite right. (I have to delete the resulting file which is
> installed by the Makefile.)
> 

I think I've got it working.. it does still install the init script, but that's not a problem, because the ebuild was going to do it anyway. What it installs is the final variable-substituted version now. If it looks good to you, I can make it v0.9.3 and release it. I'll then make the libdir explicit in the ebuild to fix this bug.
Comment 5 Michael Orlitzky gentoo-dev 2017-07-26 16:03:12 UTC
This should be sorted out in the latest eselect-php-0.9.4, can you give it a try please?
Comment 6 Rich Alimi 2017-07-28 03:50:32 UTC
Apologies that I will not be able to give this a try. For unrelated reasons, I have switched my Raspberry Pi 3 back to a 32-bit installation.
Comment 7 Michael Orlitzky gentoo-dev 2017-07-28 20:30:52 UTC
(In reply to Rich Alimi from comment #6)
> Apologies that I will not be able to give this a try. For unrelated reasons,
> I have switched my Raspberry Pi 3 back to a 32-bit installation.

No problem. On my 64-bit install, I now wind up with

  command="/usr/lib64/${PHP_SLOT}/bin/php-fpm"

in the php-fpm init script. Hopefully that's enough to solve this for people in similar situations. If not, I hear mgorny is pushing to remove the /usr/lib symlink, so we'll probably hear about it!