deb.sury.org
deb.sury.org copied to clipboard
the alternatives for php-config, phpize and phpdbg should match the php one automatically
update-alternatives
has a way to create secondary alternatives following the main one (used for instance for the man page).
Currently, the alternatives for php-config, phpize and phpdbg are totally independent from the php alternative. So on my machine where I switched the php alternative to be php5.6
(temporarily), phpize is still pointing to phpize7.0. This leads to an inconsistent PHP setup.
Would it make sense to have php-config, phpize and phpdbg be configured automatically based on the php alternative ?
It would make a sense, but since it's not supported by upstream, it would require patching, and it's an edge case, I am not putting this high on my priority list. Patches to implement this are welcome though.
@stof JFTR I believe you cannot use update-alternatives
cross-package, so this would need patching phpize
, php-config
and others, to always pick the versioned variant of the command they are going to use.
well, then it may not be worth it. It is quite an edge case. Documenting the edge case may be enough.
@stof Willing to write a bit about it here? https://github.com/oerdnj/deb.sury.org/wiki (everybody should have a write permission). I'll review that happily
I was also wondering which php version will be used in /usr/bin/php ?
Also the upgrade path from stock repository packages is not really documented. When I was upgrading my system, I was still having the legacy repo in place, which screwed some stuff: I had a mixed 5.6/7.0 setup afterwards.
Also libapache2-mod-php was installed without beeing asked for. The service php5.6-fpm was created, but the already running php5-fpm was not uninstalled nor deactivated.
How can I get consistent setup again? @oerdnj Can I use update-alternatives
for this task somehow?
I am running Ubuntu Trusty
@mablae The highest installed version (the priority is computed as
@mablae You have asked for documentation about PPA migration, it's a start and everybody is welcome to add more content there.
change php version
sudo update-alternatives --config php
sudo update-alternatives --config php-config
sudo update-alternatives --config phpize
i do this for composer. :heart_eyes:
@tigefa4u This is what was needed after migration from the legacy repo to new one! Thanks!
BTW If you run:
phpizeX.Y
./configure --with-php-config=php-configX.Y
It should pick the right PHP CLI binary.
Other than that it would require she'll wrapper for each command to pick the global PHP version.
I was also thinking about creating custom update-php-version
command, but that wouldn't really work because you cannot switch the commands not yet installed. And it would be very hard to detect whether the user has switched something by hand.
So, I would adhere to KISS principle here and just leave it as it is.