7.3. USES=php and Flavors

When using USES=php with one of these arguments, phpize, ext, zend, or pecl, the port will automatically have FLAVORS filled in with the PHP versions it supports.

Note:

All the examples assume the currently supported PHP versions are 5.6, 7.0, 7.1, and 7.2.

Example 7.5. Simple USES=php Extension

This will generate package for all the supported versions:

PORTNAME=	some-ext
PORTVERSION=	0.0.1
PKGNAMEPREFIX=	${PHP_PKGNAMEPREFIX}

USES=		php:ext

This will generate package for all the supported versions but 7.2:

PORTNAME=	some-ext
PORTVERSION=	0.0.1
PKGNAMEPREFIX=	${PHP_PKGNAMEPREFIX}

USES=		php:ext
IGNORE_WITH_PHP=	72

7.3.1. PHP Flavors with PHP Applications

PHP applications can also be flavorized.

This allows generating packages for all PHP versions, so that users can use them with whatever version they need on their servers.

Important:

PHP applications that are flavorized must append PHP_PKGNAMESUFFIX to their package names.

Example 7.6. Flavorizing a PHP Application

Adding Flavors support to a PHP application is straightforward:

PKGNAMESUFFIX=	${PHP_PKGNAMESUFFIX}

USES=	php:flavors

Tip:

When adding a dependency on a PHP flavored port, use @${PHP_FLAVOR}. Never use FLAVOR directly.

All FreeBSD documents are available for download at https://download.freebsd.org/ftp/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.