Doubly Active PHP

Bill Cole macportsusers-20171215 at billmail.scconsult.com
Mon Sep 9 15:03:55 UTC 2024


On 2024-09-09 at 10:20:32 UTC-0400 (Mon, 9 Sep 2024 16:20:32 +0200)
Bernard via macports-users <bernard.remacle at icloud.com>
is rumored to have said:

[...]

> How does the ‘port’ software decide on deactivation of the older 
> version? Is it perhaps done on the basis of some usage algorithm?

If you want actual deactivation, you need to do that manually. However, 
you very likely DO NOT want to deactivate anything.

For versioned package families like php, it is fine to have both 
versions active. Anything from MacPorts using php will be installed for 
a specific version. You only need to use the php_select port for tools 
NOT managed by MacPorts, which expect to have a binary named "php".

> Why is it that php82-gd is installed but not php83-gd?

Because some port has a dependency on php82-gd but apparently no port 
requires php83-gd.

> And the same with php82-mcrypt vs. php83-mycrypt, the same also with 
> php82-openssl vs. php83-openssl, the same also with php82-zip vs. 
> php83-zip?
>
> On the other hand, the reverse happens with the following:
>  php83-apache2handler @8.3.11_0 (active)
>  php83-curl @8.3.11_0 (active)
>  php83-exif @8.3.11_0 (active)
>  php83-iconv @8.3.11_0 (active)
>  php83-imagick @3.7.0_1 (active)
>  php83-pspell @8.3.11_0 (active)
>
> None of the corresponding php82 subports are installed. Why this 
> asymmetry?

You get to this state because different ports which you've installed 
specify their different PHP dependencies differently.

It will not usually clean itself up. Even if you run 'port reclaim' you 
won't remove old versions that were installed when a different default 
version of pHP was selected as the default.

> Or is this haphazard installation of ports/subports not unusual?

It is neither "haphazard" nor unusual.

If you want to clean it up manually, you would need to determine whether 
anything is still depending on php82. To do that you can just look at 
the full recursive tree of dependents for that port:

	port rdependents php82

That will show a tree of dependent packages. If any of those packages is 
something that you know you want to keep, you can check its direct 
explicit dependencies (port deps portname) to see if it specifies php82 
or just a php binary or library. If a specific versioned port is 
specified in the Portfile, the only way to update that sort of specific 
port dependency is for the maintainer of the port to validate an update 
to a newer version. If only a php binary is specified as a dependency, 
you can remove and reinstall that tree of dependencies to switch to the 
new version.

It is possible to get into a state where you have a tree of php82 
packages installed but no longer have any requested packages still 
depending on them. This can be fixed by running "port uninstall php82" 
and verifying that the list of ports that will be damaged by that 
removal does not include anything explicitly wanted. This should be 
handled by the first step of the "port reclaim" command (which you 
should run after every update) but sometimes a port gets marked as 
requested when it should not be, such as if you install a bunch of 
interdependent ports in one explicit long command line rather than 
having MacPorts work out the dependencies of a single wanted port.


-- 
Bill Cole
bill at scconsult.com or billcole at apache.org
(AKA @grumpybozo at toad.social and many *@billmail.scconsult.com 
addresses)
Not Currently Available For Hire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20240909/a1f84bdb/attachment.htm>


More information about the macports-users mailing list