# Why is pkg picking the oldest available PHP version?



## Jonathan Price (Oct 28, 2020)

Hello,

I was trying to work out why a server was stuck on PHP 7.2 when the default version of PHP should be 7.4 as of 2020-09-14 (according to UPDATING, and looking at bsd.default-versions.mk).

There are two packages installed that are dependent on php: www/owncloud and mail/rainloop-community.

I span up a blank VM and tried to install each of them. I have included the output from pkg for both of these below.

It appears that the pkg database contains owncloud-php74-10.5.0, owncloud-php73-10.5.0 and owncloud-php72-10.5.0, presumably to support people running these three versions of PHP. And similarly, rainloop-community has rainloop-community-php73-1.14.0 and rainloop-community-php72-1.14.0.

This has raised a few questions for me:
- Considering the blank VM doesn't have PHP installed yet, why is it resolving the conflicting versions available by picking the oldest one (php 7.2) for both packages?
- Why does the rainloop-community package only have 7.2 and 7.3 and not 7.4? I had a look at the Makefile to see if the maintainer had specified a specific verison, but nothing I can see
- If I try to install php73 after having install owncloud or rainloop-community, pkg simply uninstalls those packages and makes no attempt to install php7.3 versions even though packages exist for them. Why is this happening? I included a copy of the output when I tried this below

Any assistance is greatly appreciated. As things stand, I have working packages if I let it just stick to PHP 7.2, but it would be nice to understand what's going on in this situation.

Thanks,
Jonathan.

*owncloud output:*


```
pricej@freebsd:/usr/ports/www % sudo pkg install www/owncloud
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 121 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        avahi-app: 0.7_3
        curl: 7.72.0
        dbus: 1.12.20
        dbus-glib: 0.110
        gamin: 0.1.10_10
        gnome_subr: 1.0
        gobject-introspection: 1.66.0_1,1
        icu: 67.1,1
        jansson: 2.13.1
        jbigkit: 2.1_1
        jpeg-turbo: 2.0.5
        libXpm: 3.5.13
        libarchive: 3.4.3,1
        libargon2: 20190702
        libdaemon: 0.14_1
        libgd: 2.3.0,1
        libnghttp2: 1.41.0
        libsunacl: 1.0.1
        libxslt: 1.1.34_1
        libzip: 1.5.2
        lmdb: 0.9.24_3,1
        lzo2: 2.10_1
        oniguruma: 6.9.5.r1_1
        openldap-client: 2.4.51
        owncloud-php72: 10.5.0
        owncloud-php73: 10.5.0
        owncloud-php74: 10.5.0
        pcre2: 10.35
        php72: 7.2.34
        php72-bz2: 7.2.34
        php72-ctype: 7.2.34
        php72-curl: 7.2.34
        php72-dom: 7.2.34
        php72-exif: 7.2.34
        php72-fileinfo: 7.2.34
        php72-filter: 7.2.34
        php72-gd: 7.2.34
        php72-hash: 7.2.34
        php72-iconv: 7.2.34
        php72-intl: 7.2.34
        php72-json: 7.2.34
        php72-ldap: 7.2.34
        php72-mbstring: 7.2.34
        php72-openssl: 7.2.34
        php72-pdo: 7.2.34
        php72-pdo_mysql: 7.2.34
        php72-pecl-smbclient: 1.0.0_1
        php72-posix: 7.2.34
        php72-session: 7.2.34
        php72-simplexml: 7.2.34
        php72-xml: 7.2.34
        php72-xmlreader: 7.2.34
        php72-xmlwriter: 7.2.34
        php72-xsl: 7.2.34
        php72-zip: 7.2.34
        php72-zlib: 7.2.34
        php73: 7.3.23
        php73-bz2: 7.3.23
        php73-ctype: 7.3.23
        php73-curl: 7.3.23
        php73-dom: 7.3.23
        php73-exif: 7.3.23
        php73-fileinfo: 7.3.23
        php73-filter: 7.3.23
        php73-gd: 7.3.23
        php73-hash: 7.3.23
        php73-iconv: 7.3.23
        php73-intl: 7.3.23
        php73-json: 7.3.23
        php73-ldap: 7.3.23
        php73-mbstring: 7.3.23
        php73-openssl: 7.3.23
        php73-pdo: 7.3.23
        php73-pdo_mysql: 7.3.23
        php73-pecl-smbclient: 1.0.0_1
        php73-posix: 7.3.23
        php73-session: 7.3.23
        php73-simplexml: 7.3.23
        php73-xml: 7.3.23
        php73-xmlreader: 7.3.23
        php73-xmlwriter: 7.3.23
        php73-xsl: 7.3.23
        php73-zip: 7.3.23
        php73-zlib: 7.3.23
        php74: 7.4.11
        php74-bz2: 7.4.11
        php74-ctype: 7.4.11
        php74-curl: 7.4.11
        php74-dom: 7.4.11
        php74-exif: 7.4.11
        php74-fileinfo: 7.4.11
        php74-filter: 7.4.11
        php74-gd: 7.4.11
        php74-iconv: 7.4.11
        php74-intl: 7.4.11
        php74-json: 7.4.11
        php74-ldap: 7.4.11
        php74-mbstring: 7.4.11
        php74-openssl: 7.4.11
        php74-pdo: 7.4.11
        php74-pdo_mysql: 7.4.11
        php74-pecl-smbclient: 1.0.0_1
        php74-posix: 7.4.11
        php74-session: 7.4.11
        php74-simplexml: 7.4.11
        php74-xml: 7.4.11
        php74-xmlreader: 7.4.11
        php74-xmlwriter: 7.4.11
        php74-xsl: 7.4.11
        php74-zip: 7.4.11
        php74-zlib: 7.4.11
        popt: 1.18_1
        py37-dnspython: 1.16.0
        py37-markdown: 2.6.11_1
        py37-setuptools: 44.0.0
        samba410: 4.10.18
        talloc: 2.3.1
        tdb: 1.4.3,1
        tevent: 0.10.2
        tiff: 4.1.0
        webp: 1.1.0

Number of packages to be installed: 121

The process will require 657 MiB more space.
1 MiB to be downloaded.

Proceed with this action? [y/N]:


--------------------------------------------------

Checking integrity... done (87 conflicting)
  - owncloud-php73-10.5.0 conflicts with owncloud-php72-10.5.0 on /usr/local/share/examples/owncloud/newsyslog
  - owncloud-php74-10.5.0 conflicts with owncloud-php72-10.5.0 on /usr/local/share/examples/owncloud/newsyslog
  - owncloud-php74-10.5.0 conflicts with owncloud-php73-10.5.0 on /usr/local/www/owncloud/.htaccess
  - php73-session-7.3.23 conflicts with php72-session-7.2.34 on /usr/local/include/php/ext/session/php_session.h
  - php73-7.3.23 conflicts with php72-7.2.34 on /usr/local/bin/php
  - php73-xsl-7.3.23 conflicts with php72-xsl-7.2.34 on /usr/local/include/php/ext/xsl/xsl_fe.h
  - php73-xml-7.3.23 conflicts with php72-xml-7.2.34 on /usr/local/include/php/ext/xml/php_xml.h
  - php73-dom-7.3.23 conflicts with php72-dom-7.2.34 on /usr/local/include/php/ext/dom/dom_ce.h
  - php73-xmlwriter-7.3.23 conflicts with php72-xmlwriter-7.2.34 on /usr/local/include/php/ext/xmlwriter/config.h
  - php73-xmlreader-7.3.23 conflicts with php72-xmlreader-7.2.34 on /usr/local/include/php/ext/xmlreader/config.h
  - php73-simplexml-7.3.23 conflicts with php72-simplexml-7.2.34 on /usr/local/include/php/ext/simplexml/php_simplexml.h
  - php73-ctype-7.3.23 conflicts with php72-ctype-7.2.34 on /usr/local/include/php/ext/ctype/config.h
  - php73-posix-7.3.23 conflicts with php72-posix-7.2.34 on /usr/local/include/php/ext/posix/config.h
  - php73-fileinfo-7.3.23 conflicts with php72-fileinfo-7.2.34 on /usr/local/include/php/ext/fileinfo/config.h
  - php73-openssl-7.3.23 conflicts with php72-openssl-7.2.34 on /usr/local/include/php/ext/openssl/config.h
  - php73-hash-7.3.23 conflicts with php72-hash-7.2.34 on /usr/local/include/php/ext/hash/php_hash_crc32_tables.h
  - php73-filter-7.3.23 conflicts with php72-filter-7.2.34 on /usr/local/include/php/ext/filter/filter_private.h
  - php73-ldap-7.3.23 conflicts with php72-ldap-7.2.34 on /usr/local/include/php/ext/ldap/config.h
  - php73-pecl-smbclient-1.0.0_1 conflicts with php72-pecl-smbclient-1.0.0_1 on /usr/local/include/php/ext/smbclient/config.h
  - php73-gd-7.3.23 conflicts with php72-gd-7.2.34 on /usr/local/include/php/ext/gd/gd_compat.h
  - php73-exif-7.3.23 conflicts with php72-exif-7.2.34 on /usr/local/include/php/ext/exif/config.h
  - php73-curl-7.3.23 conflicts with php72-curl-7.2.34 on /usr/local/include/php/ext/curl/config.h
  - php73-json-7.3.23 conflicts with php72-json-7.2.34 on /usr/local/include/php/ext/json/php_json_encoder.h
  - php73-intl-7.3.23 conflicts with php72-intl-7.2.34 on /usr/local/include/php/ext/intl/intl_error.h
  - php73-pdo_mysql-7.3.23 conflicts with php72-pdo_mysql-7.2.34 on /usr/local/include/php/ext/pdo_mysql/php_pdo_mysql.h
  - php73-pdo-7.3.23 conflicts with php72-pdo-7.2.34 on /usr/local/include/php/ext/pdo/php_pdo.h
  - php73-mbstring-7.3.23 conflicts with php72-mbstring-7.2.34 on /usr/local/include/php/ext/mbstring/php_mbregex.h
  - php73-iconv-7.3.23 conflicts with php72-iconv-7.2.34 on /usr/local/include/php/ext/iconv/config.h
  - php73-zlib-7.3.23 conflicts with php72-zlib-7.2.34 on /usr/local/include/php/ext/zlib/php_zlib.h
  - php73-zip-7.3.23 conflicts with php72-zip-7.2.34 on /usr/local/include/php/ext/zip/php_zip.h
  - php73-bz2-7.3.23 conflicts with php72-bz2-7.2.34 on /usr/local/include/php/ext/bz2/php_bz2.h
  - php74-session-7.4.11 conflicts with php72-session-7.2.34 on /usr/local/include/php/ext/session/php_session.h
  - php74-session-7.4.11 conflicts with php73-session-7.3.23 on /usr/local/include/php/ext/session/mod_user.h
  - php74-7.4.11 conflicts with php72-7.2.34 on /usr/local/bin/php
  - php74-7.4.11 conflicts with php73-7.3.23 on /usr/local/bin/php-cgi
  - php74-7.4.11 conflicts with php72-hash-7.2.34 on /usr/local/include/php/ext/hash/php_hash.h
  - php74-7.4.11 conflicts with php73-hash-7.3.23 on /usr/local/include/php/ext/hash/php_hash_adler32.h
  - php74-xsl-7.4.11 conflicts with php72-xsl-7.2.34 on /usr/local/include/php/ext/xsl/xsl_fe.h
  - php74-xsl-7.4.11 conflicts with php73-xsl-7.3.23 on /usr/local/include/php/ext/xsl/php_xsl.h
  - php74-xml-7.4.11 conflicts with php72-xml-7.2.34 on /usr/local/include/php/ext/xml/php_xml.h
  - php74-xml-7.4.11 conflicts with php73-xml-7.3.23 on /usr/local/include/php/ext/xml/config.h
  - php74-dom-7.4.11 conflicts with php72-dom-7.2.34 on /usr/local/include/php/ext/dom/dom_ce.h
  - php74-dom-7.4.11 conflicts with php73-dom-7.3.23 on /usr/local/include/php/ext/dom/xml_common.h
  - php74-xmlwriter-7.4.11 conflicts with php72-xmlwriter-7.2.34 on /usr/local/include/php/ext/xmlwriter/config.h
  - php74-xmlwriter-7.4.11 conflicts with php73-xmlwriter-7.3.23 on /usr/local/include/php/ext/xmlwriter/php_xmlwriter.h
  - php74-xmlreader-7.4.11 conflicts with php72-xmlreader-7.2.34 on /usr/local/include/php/ext/xmlreader/config.h
  - php74-xmlreader-7.4.11 conflicts with php73-xmlreader-7.3.23 on /usr/local/include/php/ext/xmlreader/php_xmlreader.h
  - php74-simplexml-7.4.11 conflicts with php72-simplexml-7.2.34 on /usr/local/include/php/ext/simplexml/php_simplexml.h
  - php74-simplexml-7.4.11 conflicts with php73-simplexml-7.3.23 on /usr/local/include/php/ext/simplexml/sxe.h
  - php74-ctype-7.4.11 conflicts with php72-ctype-7.2.34 on /usr/local/include/php/ext/ctype/config.h
  - php74-ctype-7.4.11 conflicts with php73-ctype-7.3.23 on /usr/local/include/php/ext/ctype/php_ctype.h
  - php74-posix-7.4.11 conflicts with php72-posix-7.2.34 on /usr/local/include/php/ext/posix/config.h
  - php74-posix-7.4.11 conflicts with php73-posix-7.3.23 on /usr/local/include/php/ext/posix/php_posix.h
  - php74-fileinfo-7.4.11 conflicts with php72-fileinfo-7.2.34 on /usr/local/include/php/ext/fileinfo/config.h
  - php74-fileinfo-7.4.11 conflicts with php73-fileinfo-7.3.23 on /usr/local/include/php/ext/fileinfo/php_fileinfo.h
  - php74-openssl-7.4.11 conflicts with php72-openssl-7.2.34 on /usr/local/include/php/ext/openssl/config.h
  - php74-openssl-7.4.11 conflicts with php73-openssl-7.3.23 on /usr/local/include/php/ext/openssl/php_openssl.h
  - php74-filter-7.4.11 conflicts with php72-filter-7.2.34 on /usr/local/include/php/ext/filter/filter_private.h
  - php74-filter-7.4.11 conflicts with php73-filter-7.3.23 on /usr/local/include/php/ext/filter/config.h
  - php74-ldap-7.4.11 conflicts with php72-ldap-7.2.34 on /usr/local/include/php/ext/ldap/config.h
  - php74-ldap-7.4.11 conflicts with php73-ldap-7.3.23 on /usr/local/include/php/ext/ldap/php_ldap.h
  - php74-pecl-smbclient-1.0.0_1 conflicts with php72-pecl-smbclient-1.0.0_1 on /usr/local/include/php/ext/smbclient/config.h
  - php74-pecl-smbclient-1.0.0_1 conflicts with php73-pecl-smbclient-1.0.0_1 on /usr/local/include/php/ext/smbclient/php_smbclient.h
  - php74-gd-7.4.11 conflicts with php72-gd-7.2.34 on /usr/local/include/php/ext/gd/gd_compat.h
  - php74-gd-7.4.11 conflicts with php73-gd-7.3.23 on /usr/local/include/php/ext/gd/php_gd.h
  - php74-exif-7.4.11 conflicts with php72-exif-7.2.34 on /usr/local/include/php/ext/exif/config.h
  - php74-exif-7.4.11 conflicts with php73-exif-7.3.23 on /usr/local/include/php/ext/exif/php_exif.h
  - php74-curl-7.4.11 conflicts with php72-curl-7.2.34 on /usr/local/include/php/ext/curl/config.h
  - php74-curl-7.4.11 conflicts with php73-curl-7.3.23 on /usr/local/include/php/ext/curl/php_curl.h
  - php74-json-7.4.11 conflicts with php72-json-7.2.34 on /usr/local/include/php/ext/json/php_json_encoder.h
  - php74-json-7.4.11 conflicts with php73-json-7.3.23 on /usr/local/include/php/ext/json/json_parser.tab.h
  - php74-intl-7.4.11 conflicts with php72-intl-7.2.34 on /usr/local/include/php/ext/intl/intl_error.h
  - php74-intl-7.4.11 conflicts with php73-intl-7.3.23 on /usr/local/include/php/ext/intl/intl_cppshims.h
  - php74-pdo_mysql-7.4.11 conflicts with php72-pdo_mysql-7.2.34 on /usr/local/include/php/ext/pdo_mysql/php_pdo_mysql.h
  - php74-pdo_mysql-7.4.11 conflicts with php73-pdo_mysql-7.3.23 on /usr/local/include/php/ext/pdo_mysql/php_pdo_mysql_int.h
  - php74-pdo-7.4.11 conflicts with php72-pdo-7.2.34 on /usr/local/include/php/ext/pdo/php_pdo.h
  - php74-pdo-7.4.11 conflicts with php73-pdo-7.3.23 on /usr/local/include/php/ext/pdo/config.h
  - php74-mbstring-7.4.11 conflicts with php72-mbstring-7.2.34 on /usr/local/include/php/ext/mbstring/php_mbregex.h
  - php74-mbstring-7.4.11 conflicts with php73-mbstring-7.3.23 on /usr/local/include/php/ext/mbstring/unicode_data.h
  - php74-iconv-7.4.11 conflicts with php72-iconv-7.2.34 on /usr/local/include/php/ext/iconv/config.h
  - php74-iconv-7.4.11 conflicts with php73-iconv-7.3.23 on /usr/local/include/php/ext/iconv/php_iconv.h
  - php74-zlib-7.4.11 conflicts with php72-zlib-7.2.34 on /usr/local/include/php/ext/zlib/php_zlib.h
  - php74-zlib-7.4.11 conflicts with php73-zlib-7.3.23 on /usr/local/include/php/ext/zlib/config.h
  - php74-zip-7.4.11 conflicts with php72-zip-7.2.34 on /usr/local/include/php/ext/zip/php_zip.h
  - php74-zip-7.4.11 conflicts with php73-zip-7.3.23 on /usr/local/include/php/ext/zip/config.h
  - php74-bz2-7.4.11 conflicts with php72-bz2-7.2.34 on /usr/local/include/php/ext/bz2/php_bz2.h
  - php74-bz2-7.4.11 conflicts with php73-bz2-7.3.23 on /usr/local/include/php/ext/bz2/config.h
Cannot solve problem using SAT solver, trying another plan
Cannot solve problem using SAT solver, trying another plan
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 63 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        avahi-app: 0.7_3
        curl: 7.72.0
        dbus: 1.12.20
        dbus-glib: 0.110
        gamin: 0.1.10_10
        gnome_subr: 1.0
        gobject-introspection: 1.66.0_1,1
        icu: 67.1,1
        jansson: 2.13.1
        jbigkit: 2.1_1
        jpeg-turbo: 2.0.5
        libXpm: 3.5.13
        libarchive: 3.4.3,1
        libargon2: 20190702
        libdaemon: 0.14_1
        libgd: 2.3.0,1
        libnghttp2: 1.41.0
        libsunacl: 1.0.1
        libxslt: 1.1.34_1
        libzip: 1.5.2
        lmdb: 0.9.24_3,1
        lzo2: 2.10_1
        oniguruma: 6.9.5.r1_1
        openldap-client: 2.4.51
        owncloud-php72: 10.5.0
        php72: 7.2.34
        php72-bz2: 7.2.34
        php72-ctype: 7.2.34
        php72-curl: 7.2.34
        php72-dom: 7.2.34
        php72-exif: 7.2.34
        php72-fileinfo: 7.2.34
        php72-filter: 7.2.34
        php72-gd: 7.2.34
        php72-hash: 7.2.34
        php72-iconv: 7.2.34
        php72-intl: 7.2.34
        php72-json: 7.2.34
        php72-ldap: 7.2.34
        php72-mbstring: 7.2.34
        php72-openssl: 7.2.34
        php72-pdo: 7.2.34
        php72-pdo_mysql: 7.2.34
        php72-pecl-smbclient: 1.0.0_1
        php72-posix: 7.2.34
        php72-session: 7.2.34
        php72-simplexml: 7.2.34
        php72-xml: 7.2.34
        php72-xmlreader: 7.2.34
        php72-xmlwriter: 7.2.34
        php72-xsl: 7.2.34
        php72-zip: 7.2.34
        php72-zlib: 7.2.34
        popt: 1.18_1
        py37-dnspython: 1.16.0
        py37-markdown: 2.6.11_1
        py37-setuptools: 44.0.0
        samba410: 4.10.18
        talloc: 2.3.1
        tdb: 1.4.3,1
        tevent: 0.10.2
        tiff: 4.1.0
        webp: 1.1.0

Number of packages to be installed: 63

The process will require 334 MiB more space.

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

*rainloop-community output:*



```
pricej@freebsd:/usr/ports/www % sudo pkg install mail/rainloop-community
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 26 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        curl: 7.72.0
        libargon2: 20190702
        libnghttp2: 1.41.0
        pcre2: 10.35
        php72: 7.2.34
        php72-curl: 7.2.34
        php72-dom: 7.2.34
        php72-iconv: 7.2.34
        php72-json: 7.2.34
        php72-openssl: 7.2.34
        php72-pdo: 7.2.34
        php72-pdo_sqlite: 7.2.34
        php72-xml: 7.2.34
        php72-zlib: 7.2.34
        php73: 7.3.23
        php73-curl: 7.3.23
        php73-dom: 7.3.23
        php73-iconv: 7.3.23
        php73-json: 7.3.23
        php73-openssl: 7.3.23
        php73-pdo: 7.3.23
        php73-pdo_sqlite: 7.3.23
        php73-xml: 7.3.23
        php73-zlib: 7.3.23
        rainloop-community-php72: 1.14.0
        rainloop-community-php73: 1.14.0

Number of packages to be installed: 26

The process will require 103 MiB more space.
8 MiB to be downloaded.

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





-----------------------------------------

Checking integrity... done (11 conflicting)
  - rainloop-community-php73-1.14.0 conflicts with rainloop-community-php72-1.14.0 on /usr/local/www/rainloop/data/EMPTY
  - php73-xml-7.3.23 conflicts with php72-xml-7.2.34 on /usr/local/include/php/ext/xml/php_xml.h
  - php73-7.3.23 conflicts with php72-7.2.34 on /usr/local/bin/php
  - php73-dom-7.3.23 conflicts with php72-dom-7.2.34 on /usr/local/include/php/ext/dom/dom_ce.h
  - php73-openssl-7.3.23 conflicts with php72-openssl-7.2.34 on /usr/local/include/php/ext/openssl/config.h
  - php73-curl-7.3.23 conflicts with php72-curl-7.2.34 on /usr/local/include/php/ext/curl/config.h
  - php73-json-7.3.23 conflicts with php72-json-7.2.34 on /usr/local/include/php/ext/json/php_json_encoder.h
  - php73-pdo_sqlite-7.3.23 conflicts with php72-pdo_sqlite-7.2.34 on /usr/local/include/php/ext/pdo_sqlite/php_pdo_sqlite.h
  - php73-pdo-7.3.23 conflicts with php72-pdo-7.2.34 on /usr/local/include/php/ext/pdo/php_pdo.h
  - php73-iconv-7.3.23 conflicts with php72-iconv-7.2.34 on /usr/local/include/php/ext/iconv/config.h
  - php73-zlib-7.3.23 conflicts with php72-zlib-7.2.34 on /usr/local/include/php/ext/zlib/php_zlib.h
Cannot solve problem using SAT solver, trying another plan
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 14 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        curl: 7.72.0
        libargon2: 20190702
        libnghttp2: 1.41.0
        php72: 7.2.34
        php72-curl: 7.2.34
        php72-dom: 7.2.34
        php72-iconv: 7.2.34
        php72-json: 7.2.34
        php72-openssl: 7.2.34
        php72-pdo: 7.2.34
        php72-pdo_sqlite: 7.2.34
        php72-xml: 7.2.34
        php72-zlib: 7.2.34
        rainloop-community-php72: 1.14.0

Number of packages to be installed: 14

The process will require 50 MiB more space.

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



*Installing php73 output:*



```
pricej@freebsd:/usr/ports/www % sudo pkg install php73
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (1 conflicting)
  - php73-7.3.23 conflicts with php72-7.2.34 on /usr/local/bin/php
Checking integrity... done (0 conflicting)
The following 33 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        owncloud-php72: 10.5.0
        php72: 7.2.34
        php72-bz2: 7.2.34
        php72-ctype: 7.2.34
        php72-curl: 7.2.34
        php72-dom: 7.2.34
        php72-exif: 7.2.34
        php72-fileinfo: 7.2.34
        php72-filter: 7.2.34
        php72-gd: 7.2.34
        php72-hash: 7.2.34
        php72-iconv: 7.2.34
        php72-intl: 7.2.34
        php72-json: 7.2.34
        php72-ldap: 7.2.34
        php72-mbstring: 7.2.34
        php72-openssl: 7.2.34
        php72-pdo: 7.2.34
        php72-pdo_mysql: 7.2.34
        php72-pdo_sqlite: 7.2.34
        php72-pecl-smbclient: 1.0.0_1
        php72-posix: 7.2.34
        php72-session: 7.2.34
        php72-simplexml: 7.2.34
        php72-xml: 7.2.34
        php72-xmlreader: 7.2.34
        php72-xmlwriter: 7.2.34
        php72-xsl: 7.2.34
        php72-zip: 7.2.34
        php72-zlib: 7.2.34
        rainloop-community-php72: 1.14.0

New packages to be INSTALLED:
        pcre2: 10.35
        php73: 7.3.23

Number of packages to be removed: 31
Number of packages to be installed: 2

The operation will free 145 MiB.

Proceed with this action? [y/N]: y
[1/33] Deinstalling owncloud-php72-10.5.0...
[1/33] Deleting files for owncloud-php72-10.5.0: 100%
[2/33] Deinstalling rainloop-community-php72-1.14.0...
[2/33] Deleting files for rainloop-community-php72-1.14.0: 100%
[3/33] Deinstalling php72-xsl-7.2.34...
[3/33] Deleting files for php72-xsl-7.2.34: 100%
[4/33] Deinstalling php72-xmlreader-7.2.34...
[4/33] Deleting files for php72-xmlreader-7.2.34: 100%
[5/33] Deinstalling php72-simplexml-7.2.34...
[5/33] Deleting files for php72-simplexml-7.2.34: 100%
[6/33] Deinstalling php72-xml-7.2.34...
[6/33] Deleting files for php72-xml-7.2.34: 100%
[7/33] Deinstalling php72-dom-7.2.34...
[7/33] Deleting files for php72-dom-7.2.34: 100%
[8/33] Deinstalling php72-xmlwriter-7.2.34...
[8/33] Deleting files for php72-xmlwriter-7.2.34: 100%
[9/33] Deinstalling php72-pdo_mysql-7.2.34...
[9/33] Deleting files for php72-pdo_mysql-7.2.34: 100%
[10/33] Deinstalling php72-pdo_sqlite-7.2.34...
[10/33] Deleting files for php72-pdo_sqlite-7.2.34: 100%
[11/33] Deinstalling php72-gd-7.2.34...
[11/33] Deleting files for php72-gd-7.2.34: 100%
[12/33] Deinstalling php72-curl-7.2.34...
[12/33] Deleting files for php72-curl-7.2.34: 100%
[13/33] Deinstalling php72-session-7.2.34...
[13/33] Deleting files for php72-session-7.2.34: 100%
[14/33] Deinstalling php72-ctype-7.2.34...
[14/33] Deleting files for php72-ctype-7.2.34: 100%
[15/33] Deinstalling php72-posix-7.2.34...
[15/33] Deleting files for php72-posix-7.2.34: 100%
[16/33] Deinstalling php72-fileinfo-7.2.34...
[16/33] Deleting files for php72-fileinfo-7.2.34: 100%
[17/33] Deinstalling php72-openssl-7.2.34...
[17/33] Deleting files for php72-openssl-7.2.34: 100%
[18/33] Deinstalling php72-hash-7.2.34...
[18/33] Deleting files for php72-hash-7.2.34: 100%
[19/33] Deinstalling php72-filter-7.2.34...
[19/33] Deleting files for php72-filter-7.2.34: 100%
[20/33] Deinstalling php72-ldap-7.2.34...
[20/33] Deleting files for php72-ldap-7.2.34: 100%
[21/33] Deinstalling php72-pecl-smbclient-1.0.0_1...
[21/33] Deleting files for php72-pecl-smbclient-1.0.0_1: 100%
[22/33] Deinstalling php72-iconv-7.2.34...
[22/33] Deleting files for php72-iconv-7.2.34: 100%
[23/33] Deinstalling php72-exif-7.2.34...
[23/33] Deleting files for php72-exif-7.2.34: 100%
[24/33] Deinstalling php72-json-7.2.34...
[24/33] Deleting files for php72-json-7.2.34: 100%
[25/33] Deinstalling php72-intl-7.2.34...
[25/33] Deleting files for php72-intl-7.2.34: 100%
[26/33] Deinstalling php72-pdo-7.2.34...
[26/33] Deleting files for php72-pdo-7.2.34: 100%
[27/33] Deinstalling php72-mbstring-7.2.34...
[27/33] Deleting files for php72-mbstring-7.2.34: 100%
[28/33] Deinstalling php72-zlib-7.2.34...
[28/33] Deleting files for php72-zlib-7.2.34: 100%
[29/33] Deinstalling php72-zip-7.2.34...
[29/33] Deleting files for php72-zip-7.2.34: 100%
[30/33] Deinstalling php72-bz2-7.2.34...
[30/33] Deleting files for php72-bz2-7.2.34: 100%
[31/33] Deinstalling php72-7.2.34...
[31/33] Deleting files for php72-7.2.34: 100%
[32/33] Installing pcre2-10.35...
[32/33] Extracting pcre2-10.35: 100%
[33/33] Installing php73-7.3.23...
[33/33] Extracting php73-7.3.23: 100%
```


----------



## Jonathan Price (Oct 28, 2020)

While not strictly PHP, I believe this is also relevant. I am aware that Python 2.7 is being removed at the end of the year and noticed that the last remaining package I have relying on it is denyhosts.

I tried installing denyhosts on my blank VM and found that it has denyhosts-py27 and  denyhosts-py37 flavours.

However, like with PHP, it seems to do some conflict resolution, and rather than picking the python 3 version, it picks the python 2 version and installs that. Not ideal given the EOL on Py27!


```
pricej@freebsd:/usr/ports/www % sudo pkg install denyhosts
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'denyhosts' have been found in the repositories
pricej@freebsd:/usr/ports/www % sudo pkg install security/denyhosts
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 6 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        denyhosts-py27: 3.1.2
        denyhosts-py37: 3.1.2
        py27-ipaddr: 2.2.0
        py27-setuptools: 44.0.0
        py37-ipaddr: 2.2.0
        python27: 2.7.18_1

Number of packages to be installed: 6

The process will require 74 MiB more space.
171 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/4] Fetching denyhosts-py27-3.1.2.txz: 100%   58 KiB  59.7kB/s    00:01
[2/4] Fetching denyhosts-py37-3.1.2.txz: 100%   61 KiB  62.1kB/s    00:01
[3/4] Fetching py27-ipaddr-2.2.0.txz: 100%   25 KiB  25.8kB/s    00:01
[4/4] Fetching py37-ipaddr-2.2.0.txz: 100%   27 KiB  27.2kB/s    00:01
Checking integrity... done (1 conflicting)
  - denyhosts-py37-3.1.2 conflicts with denyhosts-py27-3.1.2 on /usr/local/etc/denyhosts.conf.sample
Cannot solve problem using SAT solver, trying another plan
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        denyhosts-py27: 3.1.2
        py27-ipaddr: 2.2.0
        py27-setuptools: 44.0.0
        py37-ipaddr: 2.2.0
        python27: 2.7.18_1

Number of packages to be installed: 5

The process will require 74 MiB more space.

Proceed with this action? [y/N]: y
[1/5] Installing python27-2.7.18_1...
[1/5] Extracting python27-2.7.18_1: 100%
[2/5] Installing py27-setuptools-44.0.0...
[2/5] Extracting py27-setuptools-44.0.0: 100%
[3/5] Installing py27-ipaddr-2.2.0...
[3/5] Extracting py27-ipaddr-2.2.0: 100%
[4/5] Installing denyhosts-py27-3.1.2...
[4/5] Extracting denyhosts-py27-3.1.2: 100%
[5/5] Installing py37-ipaddr-2.2.0...
[5/5] Extracting py37-ipaddr-2.2.0: 100%
```


----------



## SirDice (Oct 28, 2020)

Use `pkg install owncloud-php74`. Same for denyhosts: `pkg install denyhosts-py37`.


----------



## Jonathan Price (Oct 28, 2020)

SirDice said:


> Use `pkg install owncloud-php74`. Same for denyhosts: `pkg install denyhosts-py37`.


Thanks SirDice. I have tested that for both packages and it is installing the correct versions.

That being said, is that not what pkg should be doing automatically when specific versions are not specified?


----------



## SirDice (Oct 28, 2020)

Good question. I usually don't rely on it, I just install the exact version I need.


----------



## shkhln (Oct 28, 2020)

"-php74" is not a version, it's a part of the package name. (Is it documented anywhere that pkg accepts port names? Why this misfeature even exists?)


----------



## SirDice (Oct 28, 2020)

shkhln said:


> "-php74" is not a version


Correct, it's the _flavor_ of this port/package. 



shkhln said:


> Are there examples anywhere of pkg accepting port names? Why this misfeature even exists?


It's been there since its inception. Look at pkg-install(8), it refers to _pkg-origin_, which is the category and name of the port. So `pkg install <category>/<port>` is just as valid as `pkg install <package-name>`.


----------



## shkhln (Oct 28, 2020)

Well, in this case pkg tries to install all 3 flavor packages for www/owncloud.


----------



## shkhln (Oct 28, 2020)

By the way, here's the issue: https://github.com/freebsd/pkg/issues/1738.


----------



## SirDice (Oct 29, 2020)

shkhln said:


> Well, in this case pkg tries to install all 3 flavor packages for www/owncloud.


I would call that a bug, that's not supposed to happen. I expect it to install the default flavor for that port.


----------

