# pkg intelligence



## thatchrisp (May 16, 2022)

Hello all,

I'm trying to "fix" my phpIPAM install.  It does not support PHP 8.0 (which is the real problem here), and I'm attempting to install it without dependencies.

When I recently upgraded PHP, I wasn't aware that it would break phpIPAM.  I've downgraded PHP back to 7.4, but when I try to reinstall phpIPAM, it wants to install PHP8 again.


```
The following 22 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        php80: 8.0.18
        php80-ctype: 8.0.18
        php80-curl: 8.0.18
        php80-dom: 8.0.18
        php80-filter: 8.0.18
        php80-gd: 8.0.18
        php80-gettext: 8.0.18
        php80-gmp: 8.0.18
        php80-iconv: 8.0.18
        php80-mbstring: 8.0.18
        php80-pcntl: 8.0.18
        php80-pdo: 8.0.18
        php80-pdo_mysql: 8.0.18
        php80-pear: 1.10.12
        php80-pecl-mcrypt: 1.0.4
        php80-posix: 8.0.18
        php80-session: 8.0.18
        php80-simplexml: 8.0.18
        php80-sockets: 8.0.18
        php80-xml: 8.0.18
        php80-zlib: 8.0.18
        phpipam: 1.4.4

Number of packages to be installed: 22
```

How can I install just phpipam, and not the dependencies?

Everything I need is already installed:


```
mod_php74-7.4.29_2             PHP Scripting Language
php74-7.4.29                   PHP Scripting Language
php74-ctype-7.4.29             The ctype shared extension for php
php74-curl-7.4.29              The curl shared extension for php
php74-dom-7.4.29               The dom shared extension for php
php74-filter-7.4.29            The filter shared extension for php
php74-gd-7.4.29                The gd shared extension for php
php74-gettext-7.4.29           The gettext shared extension for php
php74-gmp-7.4.29               The gmp shared extension for php
php74-iconv-7.4.29             The iconv shared extension for php
php74-mbstring-7.4.29          The mbstring shared extension for php
php74-pcntl-7.4.29             The pcntl shared extension for php
php74-pdo-7.4.29               The pdo shared extension for php
php74-pdo_mysql-7.4.29         The pdo_mysql shared extension for php
php74-pear-1.10.12             PEAR framework for PHP
php74-pecl-mcrypt-1.0.4        PHP extension for mcrypt, removed in PHP 7.2
php74-posix-7.4.29             The posix shared extension for php
php74-session-7.4.29           The session shared extension for php
php74-simplexml-7.4.29         The simplexml shared extension for php
php74-sockets-7.4.29           The sockets shared extension for php
php74-xml-7.4.29               The xml shared extension for php
php74-zlib-7.4.29              The zlib shared extension for php
```

Thank you in advance.


----------



## SirDice (May 16, 2022)

thatchrisp said:


> It does not support PHP 8.0 (which is the real problem here)


Certainly agree with that. There are a couple of other ports that have problems with PHP 8.0 too. Some of those ports have been fixed to explicitly build on PHP 7.4 instead of whatever is set as default. 

Package dependencies are pretty much set in stone. You cannot change the dependency on PHP 8.0 with packages. Some ports do provide 'flavors' in various PHP versions, but certainly not all ports do. To set your own 'default' version of PHP you will need to build from ports.

You can add in /etc/make.conf:

```
DEFAULT_VERSIONS+= php=7.4
```
That will cause all ports that have PHP as a dependency (and aren't set to a _specific_ version) to build against PHP 7.4.


----------



## Alain De Vos (May 16, 2022)

Fixing versions in make.conf like SirDice says fixes almost all "conflict problems".


----------



## thatchrisp (May 16, 2022)

SirDice said:


> Certainly agree with that. There are a couple of other ports that have problems with PHP 8.0 too. Some of those ports have been fixed to explicitly build on PHP 7.4 instead of whatever is set as default.
> 
> Package dependencies are pretty much set in stone. You cannot change the dependency on PHP 8.0 with packages. Some ports do provide 'flavors' in various PHP versions, but certainly not all ports do. To set your own 'default' version of PHP you will need to build from ports.
> 
> ...


Thank you, Sir.

My make.conf now looks as such:


```
WRKDIRPREFIX=           /var/ports
DISTDIR=                /var/ports/distfiles
PACKAGES=               /var/ports/packages
INDEXDIR=               /var/ports
DEFAULT_VERSIONS+= php=7.4
```

I just reran the install command, but it's still the same.  Am I missing another step?


```
pkg install phpipam
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 22 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        php80: 8.0.18
        php80-ctype: 8.0.18
        php80-curl: 8.0.18
        php80-dom: 8.0.18
        php80-filter: 8.0.18
        php80-gd: 8.0.18
        php80-gettext: 8.0.18
        php80-gmp: 8.0.18
        php80-iconv: 8.0.18
        php80-mbstring: 8.0.18
        php80-pcntl: 8.0.18
        php80-pdo: 8.0.18
        php80-pdo_mysql: 8.0.18
        php80-pear: 1.10.12
        php80-pecl-mcrypt: 1.0.4
        php80-posix: 8.0.18
        php80-session: 8.0.18
        php80-simplexml: 8.0.18
        php80-sockets: 8.0.18
        php80-xml: 8.0.18
        php80-zlib: 8.0.18
        phpipam: 1.4.4

Number of packages to be installed: 22

The process will require 53 MiB more space.
5 MiB to be downloaded.

Proceed with this action? [y/N]:
```

Again, thank you in advance.


----------



## SirDice (May 16, 2022)

thatchrisp said:


> I just reran the install command, but it's still the same. Am I missing another step?


As I said, package dependencies are set in stone. Changing the defaults in /etc/make.conf only works for building ports.

4.5. Using the Ports Collection


----------



## thatchrisp (May 16, 2022)

Ahh, got it.  Makes sense.  Thank you.


----------



## SirDice (May 16, 2022)

You could open a PR and ask the maintainer to fix the port so it builds a PHP 7.4 'flavor' of it by default. A few lines added to the port's Makefile should fix that, at least for the short term. The long term solution is of course to have upstream add support for PHP 8.x.


----------



## thatchrisp (May 16, 2022)

SirDice said:


> The long term solution is of course to have upstream add support for PHP 8.x.


I hit them up on Twitter a while back.  Crickets...


----------

