Currently all libphp references under /usr/share/eselect/modules/php.eselect are with hardcoded libphp5 prefix while the new php naturally has libphp7.
It also contains /etc/apache2/modules.d/70_mod_php5.conf that would need to be changed.
Since PHP 7.0.0 is already tagged and in portage, which should try to do something with this ;)
Created attachment 418464 [details, diff] php.eselect.patch Please test this patch to php.eselect
Now that we can't avoid updating php.eselect... does the same thing work if we replace `readlink -e` with `canonicalize`? That would fix bug #470986 in the process. It should be a close substitute for `readlink -e`: https://wiki.gentoo.org/wiki/Project:Eselect/Developer_guide#Path-manipulation_functions
Created attachment 418466 [details, diff] php.eselect.patch Please test this patch to php.eselect, try 2. As for canonicalise, the readlink -e is different than readlink -f (see the man page)
(In reply to Brian Evans from comment #5) > Created attachment 418466 [details, diff] [details, diff] > php.eselect.patch > > Please test this patch to php.eselect, try 2. As for canonicalise, the > readlink -e is different than readlink -f (see the man page) Naturally, if it was *really* easy to fix I would have posted a patch =P I'm on my way out the door but I can try to figure something out later. Calling `readlink -f` on the nonexistent "/usr/lib64/apache2/modules/libphp7.so" returns the same path (which doesn't exist), so a fix probably amounts to adding a "does the return value exist?" check.
Created attachment 418468 [details, diff] php.eselect.canonicalise.patch Here is a patch which includes canonicalise
Created attachment 418500 [details, diff] php.eselect.canonicalise.patch Here is a patch which includes canonicalise (try 2)
Created attachment 418502 [details, diff] php.eselect.canonicalise.patch Here is a patch which includes canonicalise (try 3) - fix dangling symlink
(In reply to Brian Evans from comment #9) Huge thanks Brian, tested with 5.6 and 7.0, switching works great! Now only /etc/apache2/modules.d/70_mod_php5.conf remains, maybe we can duplicate the code there and add a PHP7 IfDefine section?
Tested and worked well for me too. Thanks Brian..
This needs to be pushed asap, php 7 is a big deal for a lot of people, and it's real annoying to have it in portage but being unable to use it out of the box because eselect doesn't propose this for apache2.
*** Bug 567426 has been marked as a duplicate of this bug. ***
I just pushed a new (masked) version of eselect-php: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c711c8293c7f67c8de8e0cab5133d85b77af08d Please give that a try. I incorporated Brian's patch and made a bunch of other little changes. I moved the development to a public repo: https://gitweb.gentoo.org/proj/eselect-php.git/ This is still only a partial fix, because the apache config looks for -DPHP5 and the libphp5 module.
The 5.x and 7.x apache modules can't be used together -- apache will segfault if you try to load them both. This makes me think the "5" and "7" suffices aren't really helpful in the apache config or the module name. Since you need to choose exactly one, I'm proposing that we just drop the '5' everywhere in the apache config and the module name. The correct module will be symlinked to libphp.so using eselect-php, and then in the new apache config, we'll use -DPHP, "php_module", modules/libphp.so, etc. without reference to the version. This will require another version bump to eselect-php unfortunately.
(In reply to Michael Orlitzky from comment #15) Sounds like a good idea :)
(In reply to Michael Orlitzky from comment #15) > The 5.x and 7.x apache modules can't be used together -- apache will > segfault if you try to load them both. This makes me think the "5" and "7" > suffices aren't really helpful in the apache config or the module name. > > Since you need to choose exactly one, I'm proposing that we just drop the > '5' everywhere in the apache config and the module name. The correct module > will be symlinked to libphp.so using eselect-php, and then in the new apache > config, we'll use -DPHP, "php_module", modules/libphp.so, etc. without > reference to the version. > > This will require another version bump to eselect-php unfortunately. There is usually little to no use to have multiple version of php installed anyway. I think people will either want a "stable" version of php or the latest version of php, this should be very binary if the gentoo way can allow this by simply having a keyword switch this should be perfect.
> There is usually little to no use to have multiple version of php What? It's the coolest feature ever. Running different versions of php for fpm or apache is what makes gentoo unique. So please touch this feature.
(In reply to Thomas Stein from comment #18) > > There is usually little to no use to have multiple version of php > > What? It's the coolest feature ever. Running different versions of php for > fpm or apache is what makes gentoo unique. So please touch this feature. I respectfully disagree, i'm not in favor of removing features, ever, as i think this is indeed what makes gentoo special, but in this case i don't see the reason. Especially between a 5 and a 7, the only big big move is a performance boost and for the rest this is backward compatible it could have been named php 5.7 instead of 7.0. Also this might be cool but in what situation exactly is this usefull and not messy? running that script with php 7 and that other script with php 5.6 other than benchmarking purpose? If there is a choice between that feature and being able to run php 7.0 at all the choice is easy to me.
Don't worry, the support for multiple versions isn't going anywhere. It's useful to a lot of people. I just made another attempt at the apache2 stuff in the recently-pushed eselect-php-0.8.1: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=983c8fcbdf2b0cea1236c87ac84bf4874a916271 It's masked for testing, and shouldn't go into production yet (obviously?). But if you do PHP work on a dev machine or something, please give it a try. And read the elog, there are configuration changes! If you're not paying attention, apache won't start up again. Basically, we now use -DPHP instead of -DPHP5, and the apache config was renamed to 70_mod_php.conf from 70_mod_php5.conf. Within that config file, there is an "Include" statement that points to another config managed by eselect. This was the only way I could get the switching to work seamlessly; the two modules (php5_module and php7_module) have different names and there's no way to deal with that inside apache. So eselect now handles it. Which means... you have to run eselect once before apache will work! But afterwards, you should be able to switch between 5.x and 7.x with an apache restart/reload.
> Don't worry, the support for multiple versions isn't going anywhere Uh. I feel better already. :-) eselect-php-0.8.1 works for me: sites ~ # eselect php list apache2 [1] php7.0 * sites ~ # thanks and cheers t.
works for me aswell, now that should probably be unmasked :)
Thanks Michael, tested with PHP 5.5 + 7.0 with apache, works great.
pkg_postinst() of dev-lang/php-7.x needs to be updated: if use apache2 ; then APACHE2_MOD_DEFINE="PHP" APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php apache-module_pkg_postinst fi
(In reply to Tomáš Mózes from comment #24) > pkg_postinst() of dev-lang/php-7.x needs to be updated: > > if use apache2 ; then > APACHE2_MOD_DEFINE="PHP" > APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php > apache-module_pkg_postinst > fi Thanks for this. I just changed it in-place for php-7.0.1. In the next version of php:5.6, maybe we should require the newer eselect-php; then we could make the same change there.
I just updated "PHP5" to "PHP" in the most recent version bumps (even though that may wind up being incorrect if they go stable quickly). Best I could do though. I think that was the last bullet point so I'm gonna say this is fixed.
Thank you all for this, I'm glad we can enjoy PHP7 with Apache on Gentoo :)