• install default or latest version of php with pkg

    From Andriy Gapon@avg@FreeBSD.org to muc.lists.freebsd.ports on Tue Oct 14 19:36:13 2025
    From Newsgroup: muc.lists.freebsd.ports


    I am writing a recipe to configure a system for a particular purpose.
    I need to install some version of PHP, doesn't matter much which, but it should
    be a recent one. E.g., the latest available in ports or the default version.
    I do not want to hardcode any version / prefix like, say, "php83" (because it may be obsolete or unavailable in a few years).

    How could this be achieved with pkg?
    --
    Andriy Gapon



    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Moin Rahman@bofh@freebsd.org to muc.lists.freebsd.ports on Tue Oct 14 18:45:47 2025
    From Newsgroup: muc.lists.freebsd.ports


    --Apple-Mail=_719D35E7-61CB-4EB1-BA27-FE4B6E5AE7AC
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
    charset=us-ascii



    On Oct 14, 2025, at 18:36, Andriy Gapon <avg@FreeBSD.org> wrote:
    =20
    =20
    I am writing a recipe to configure a system for a particular purpose.
    I need to install some version of PHP, doesn't matter much which, but =
    it should be a recent one. E.g., the latest available in ports or the = default version.
    I do not want to hardcode any version / prefix like, say, "php83" =
    (because it may be obsolete or unavailable in a few years).
    =20
    How could this be achieved with pkg?
    =20
    --=20
    Andriy Gapon
    =20
    =20

    I do not know what actually you are trying to do or if I have understood
    you correctly. But let's say if I need dokuwiki and I do not want to add specific version I just do `pkg install www/dokuwiki` which will find
    out the required php version suffix and install all the php =
    requirements.
    But if you need are using this for a custom application which is not in
    the tree and you need to install specific php versions for those then I
    believe you are out of options.

    Kind regards,
    Moin=

    --Apple-Mail=_719D35E7-61CB-4EB1-BA27-FE4B6E5AE7AC
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment;
    filename=signature.asc
    Content-Type: application/pgp-signature;
    name=signature.asc
    Content-Description: Message signed with OpenPGP

    -----BEGIN PGP SIGNATURE-----

    iQKTBAEBCgB9FiEETfdREoUGjQZKBS+fvbm1phfAvJEFAmjufjtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDRE Rjc1MTEyODUwNjhEMDY0QTA1MkY5RkJEQjlCNUE2MTdDMEJDOTEACgkQvbm1phfA vJG6kA/9HzNSuL67Uff79PMznY0eM9glumhYhbQR/9fr8gT0FjtYqJwFBAnbrEx/ SG4fo+RluQjQlcW2y3OQGbhZoZUKiQJYHnVBF/RKbBPNOUoq6fL0kz7XROu38O4t 8p0qR6Ni74m2+SL60FB/exi6+jm8jKHmnnn/enQQjTPjcUXdw9D9SZFT61QEJ8Ke K9cCe/BpHDRGgJMo2YlHxB5vgG7fcIFaPr4b1wf1TXUEVkN/NLkUa5DsoBu/rx7p I2txLBZ5HeNRtaZGmkRsSyNl09LRVVv4Usf343hHik7TOvooGql3Od1OsVGsXlG6 rYPYahGi3ifpIJ7GLBU+oCX7TnP3uYOU29dtS6WqyB5q0Gi4Y8ioq6zDPlvUWP/F mcmdNtSBoaKNF53mgqDjXva9HIYUs8kMfOzp3mY007VCjtkRChFCeIKrfxe46SeY G2QIgVoWwSd3s4pgh+jv1toYHUpR3peHGA6eL4CMVOLLVGkbUlHoPNMXn0kaTeDM eUPf2ND1acVePDkhti9Q5HhDuOFw3KpydKObEK4JIWCp2lwiK4mBPY2ZzY89vIVx ryUm3tPdQRlp855ZVK/FQsIt5u+bp9AH/hRxwe0V3UNZCnf7zKszb6zq9MecznxD OzC+AVsyO7qEOsTHc/RXH2h4bv931TMKtTBzZwhGIQl0hzWo+DA=
    =X2Db
    -----END PGP SIGNATURE-----

    --Apple-Mail=_719D35E7-61CB-4EB1-BA27-FE4B6E5AE7AC--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Andriy Gapon@avg@FreeBSD.org to muc.lists.freebsd.ports on Tue Oct 14 19:50:41 2025
    From Newsgroup: muc.lists.freebsd.ports

    On 14/10/2025 19:45, Moin Rahman wrote:


    On Oct 14, 2025, at 18:36, Andriy Gapon <avg@FreeBSD.org> wrote:


    I am writing a recipe to configure a system for a particular purpose.
    I need to install some version of PHP, doesn't matter much which, but it should be a recent one. E.g., the latest available in ports or the default version.
    I do not want to hardcode any version / prefix like, say, "php83" (because it may be obsolete or unavailable in a few years).

    How could this be achieved with pkg?

    I do not know what actually you are trying to do or if I have understood
    you correctly. But let's say if I need dokuwiki and I do not want to add specific version I just do `pkg install www/dokuwiki` which will find
    out the required php version suffix and install all the php requirements.
    But if you need are using this for a custom application which is not in
    the tree and you need to install specific php versions for those then I believe you are out of options.
    Yes, it's for something that's not in ports.
    But maybe it could be put into ports with some effort...

    Maybe it would be a good idea to have some PHP meta-ports that just install default versions?

    E.g., for Python there is a python3 package that installs a current default python3.xx version as dependency and there is python package that installs a current default pythonX (python3 currently) as a dependency.
    --
    Andriy Gapon


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Moin Rahman@bofh@freebsd.org to muc.lists.freebsd.ports on Tue Oct 14 18:54:20 2025
    From Newsgroup: muc.lists.freebsd.ports


    --Apple-Mail=_7D100F0C-EFF3-4401-8FB9-4683A5DEC308
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
    charset=us-ascii



    On Oct 14, 2025, at 18:50, Andriy Gapon <avg@FreeBSD.org> wrote:
    =20
    On 14/10/2025 19:45, Moin Rahman wrote:
    On Oct 14, 2025, at 18:36, Andriy Gapon <avg@FreeBSD.org> wrote:
    =20
    =20
    I am writing a recipe to configure a system for a particular =
    purpose.
    I need to install some version of PHP, doesn't matter much which, =
    but it should be a recent one. E.g., the latest available in ports or =
    the default version.
    I do not want to hardcode any version / prefix like, say, "php83" = (because it may be obsolete or unavailable in a few years).
    =20
    How could this be achieved with pkg?
    I do not know what actually you are trying to do or if I have =
    understood
    you correctly. But let's say if I need dokuwiki and I do not want to =
    add
    specific version I just do `pkg install www/dokuwiki` which will find
    out the required php version suffix and install all the php =
    requirements.
    But if you need are using this for a custom application which is not =
    in
    the tree and you need to install specific php versions for those then =
    I
    believe you are out of options.
    Yes, it's for something that's not in ports.
    But maybe it could be put into ports with some effort...
    =20
    Maybe it would be a good idea to have some PHP meta-ports that just =
    install default versions?
    =20
    E.g., for Python there is a python3 package that installs a current =
    default python3.xx version as dependency and there is python package =
    that installs a current default pythonX (python3 currently) as a =
    dependency.
    =20
    --=20
    Andriy Gapon
    =20

    This also brings some complexity like how are we going to handle =
    different
    extensions. Or should we create different ports for each extensions. Not=20=

    all extensions are common for all versions. Or should we just add the
    php and php-extensions?

    Let me think about it.

    Kind regards,
    Moin=

    --Apple-Mail=_7D100F0C-EFF3-4401-8FB9-4683A5DEC308
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment;
    filename=signature.asc
    Content-Type: application/pgp-signature;
    name=signature.asc
    Content-Description: Message signed with OpenPGP

    -----BEGIN PGP SIGNATURE-----

    iQKTBAEBCgB9FiEETfdREoUGjQZKBS+fvbm1phfAvJEFAmjugDxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDRE Rjc1MTEyODUwNjhEMDY0QTA1MkY5RkJEQjlCNUE2MTdDMEJDOTEACgkQvbm1phfA vJGlZg/+ObbX/uO8T/HNVqOiH5n0Hr8Az2EE07DKxvxw8lhHKF/VKpwr4MATFI8j osmV0nC6ULROgkNkTuaoBanPxFAUsp+N5jLNDq8/VvtmlrY9m5QdRCIC8kQLngZ9 OTQLqOONN499bE9oqkoNRTJeiUAv7aJkHhz+fR2OqKkANwPeTGqBlckDWmvruWcB cWppFsAYvK/B/amD/MwnHYzwh1eW0PG/WQLTaXMwZTsZ32LC6ywH92yTR8vQ5hhw Pv0SbmiFgEfAYFI3xVkQXY/iR1xacTRW8SY7QnOuiIt1dy8YB+B1VF2qSDNB/ETF XxOUmjE4IlZ1+ZMu/v761MSI4+ZhF2DzPNhVewkQwIhKJbiFQ8rgsnmXdwk1PwMH UTtipZBJdc+10js5/1lbwVtORz0GiTGfYQZ3cMQfOMbN3/flblxpXNM0gzmY/7Xm o1e3b95j4WAbATnSHeIOOLDcBEdBsAQsyubV/9Lcgmuo6hHK9kyHLPEnD40xfQH2 m67rrSASE89NVCYg6EIbhbb522/LIFI7FYk++Pu8UZM6lCI/gtsTHGCu4R5gatGm 547AqyFUqC1GBYmQPikhSoKCeQadUslZcuVvWL4c1D/eiEH0mf+xekY67TnjlOiA /cpruQ0YFaNSXoXU+ekJ0l3LtuLK4kK5aaGnPjhsQp/U9LBZADE=
    =f62O
    -----END PGP SIGNATURE-----

    --Apple-Mail=_7D100F0C-EFF3-4401-8FB9-4683A5DEC308--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Moin Rahman@bofh@freebsd.org to muc.lists.freebsd.ports on Tue Oct 14 19:47:02 2025
    From Newsgroup: muc.lists.freebsd.ports


    --Apple-Mail=_8F9E8972-503C-46D2-AEE6-D7D17FE95DBB
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
    charset=us-ascii



    On Oct 14, 2025, at 19:45, Andriy Gapon <avg@FreeBSD.org> wrote:
    =20
    On 14/10/2025 20:41, Miroslav Lachman wrote:
    If you are writing some playbook or scripted setup, you can query = available versions by pkg search, for example:
    # pkg search -x '^php8[0-9]-[0-9]'
    Sort the results, tail -n1 and you have the latest available version. =
    Then you can say which PHP extensions to install.
    =20
    I guess that this is the simplest and easiest solution at the moment.
    Thank you!
    =20
    Be aware that the latest php85 is not yet a stable release. :/

    Kind regards,
    Moin=

    --Apple-Mail=_8F9E8972-503C-46D2-AEE6-D7D17FE95DBB
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment;
    filename=signature.asc
    Content-Type: application/pgp-signature;
    name=signature.asc
    Content-Description: Message signed with OpenPGP

    -----BEGIN PGP SIGNATURE-----

    iQKTBAEBCgB9FiEETfdREoUGjQZKBS+fvbm1phfAvJEFAmjujJZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDRE Rjc1MTEyODUwNjhEMDY0QTA1MkY5RkJEQjlCNUE2MTdDMEJDOTEACgkQvbm1phfA vJGTiQ//U13BNl3pxm9zNvcx2dNou8a3Pot9/PETCBpMMh+1QChDDFa1taLVL3c1 9SRh4D3TUnEZCKnSyM5IEM71T7a+dMwPm8rn4NAZ6N96wqM5OR8jl+h/STS7SonH 2pJBvvKVvM5xRlbhSE5xSmofGA/UCEHfYswtQNTFOXkyHYqEtQqtcuK7KNEHoaID UapnUARz3Xv7xMXMlnx5Qq52krsskgglCGHVa7b22iS+7OYXPMXB7R4DnjBEN6CW YHL/m3Os3kh/WTwzSQ5XeW7IP72hhzUtkBlO6F7nAn/Xwe9tWUecTf3WLCFmTZnG 8rs+KSEbPqjkjm7BmVsUTzhCJiYJj+LVCRmwrGnUu2dNog/cAVHAqZ9ACestyIEF ARVS1oFnjJwFV5bBu1okmviaiZP7iBFA6QmXGLkNd+gatI29YwMiPBeGXGQ5UeL+ pMzAhqBkUT4KgYsuo7aipTKzWbTpWz2910w5qG/iSh5zc4kka5jV1G/vhHzPaQVh 4+bCVrL2IB0bsipZxj2Yx+0J5cACN2RNfXCL4DbqRQdiSIwEy2pHintCVToJbuHu xLgtNe/YrsE3rV2IGunVkciAL8BpP4gfmVhqvxAuFD9ZVHJMoHXnKR/oQ/Ghm4Dq OmjBNQAJMEs55RSH43Gv5vj9ZT37BBP6hm6zRrxoMAFcRMKYbng=
    =VGLA
    -----END PGP SIGNATURE-----

    --Apple-Mail=_8F9E8972-503C-46D2-AEE6-D7D17FE95DBB--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Andriy Gapon@avg@FreeBSD.org to muc.lists.freebsd.ports on Tue Oct 14 21:08:25 2025
    From Newsgroup: muc.lists.freebsd.ports

    On 14/10/2025 20:47, Moin Rahman wrote:


    On Oct 14, 2025, at 19:45, Andriy Gapon <avg@FreeBSD.org> wrote:

    On 14/10/2025 20:41, Miroslav Lachman wrote:
    If you are writing some playbook or scripted setup, you can query available versions by pkg search, for example:
    # pkg search -x '^php8[0-9]-[0-9]'
    Sort the results, tail -n1 and you have the latest available version. Then you can say which PHP extensions to install.

    I guess that this is the simplest and easiest solution at the moment.
    Thank you!

    Be aware that the latest php85 is not yet a stable release. :/

    I'll go with the line before the last then :-)
    --
    Andriy Gapon


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2