Hi all,
I've been working on this for my own servers and thought it might be useful to others who host PHP applications on FreeBSD.
opt-php is an unofficial pkg repository with every PHP branch from 5.6 to 8.6. Each version installs self-contained under /opt/php/X.Y, with its own php.ini, conf.d, PHP-FPM service and
socket, so several versions can coexist on the same host or jail, alongside the official php8x packages.
How it's built:
- It uses the security backports maintained for Debian by deb.sury.org and the Debian PHP team, together with work by Freexian and Remi Collet.
- Sources come from php.net and pecl.php.net, and the patches applied to each port are kept in the source repository, so they can be reviewed (and the ports built) without fetching
anything else.
- New upstream patches are screened automatically; anything touching networking or telemetry is held back for manual review before it is built.
- Packages are built with poudriere against the exact ports tree commit of the official package set, so dependencies come from pkg.FreeBSD.org.
- Upstream sources are checked every 30 minutes, and everything is rebuilt incrementally every night.
- Over 300 packages: the core, the usual extensions and popular PECL modules (redis, imagick, apcu, igbinary, xdebug...). PHP 8.6 currently ships the core and bundled extensions; its PECL
modules will follow as soon as they are available upstream.
- Supported targets for now: FreeBSD 15 amd64, latest and quarterly.
- The PHP2Shell fix is included in all branches.
Quick start:
- Repository and docs: https://pkg.indeax.com/
- Build status and history: https://pkg.indeax.com/status/
- Sources: https://github.com/Indeax/opt-php
This is a personal, best-effort project with no guarantees; use it at your own risk. Old PHP branches are only as secure as the available backports. Feedback, bug reports and suggestions
are very welcome.
Many thanks to everyone who keeps old PHP branches alive with security backports and to all FreeBSD team and maintainers.
I've been working on this for my own servers and thought it might be useful to others who host PHP applications on FreeBSD.
opt-php is an unofficial pkg repository with every PHP branch from 5.6 to 8.6. Each version installs self-contained under /opt/php/X.Y, with its own php.ini, conf.d, PHP-FPM service and
socket, so several versions can coexist on the same host or jail, alongside the official php8x packages.
How it's built:
- It uses the security backports maintained for Debian by deb.sury.org and the Debian PHP team, together with work by Freexian and Remi Collet.
- Sources come from php.net and pecl.php.net, and the patches applied to each port are kept in the source repository, so they can be reviewed (and the ports built) without fetching
anything else.
- New upstream patches are screened automatically; anything touching networking or telemetry is held back for manual review before it is built.
- Packages are built with poudriere against the exact ports tree commit of the official package set, so dependencies come from pkg.FreeBSD.org.
- Upstream sources are checked every 30 minutes, and everything is rebuilt incrementally every night.
- Over 300 packages: the core, the usual extensions and popular PECL modules (redis, imagick, apcu, igbinary, xdebug...). PHP 8.6 currently ships the core and bundled extensions; its PECL
modules will follow as soon as they are available upstream.
- Supported targets for now: FreeBSD 15 amd64, latest and quarterly.
- The PHP2Shell fix is included in all branches.
Quick start:
Code:
fetch -o /usr/local/etc/ssl/certs/opt-php.pub https://pkg.indeax.com/opt-php/opt-php.pub
sha256 /usr/local/etc/ssl/certs/opt-php.pub
# SHA256 = 1f307fb7616ea91db4be2dc6ee2108f9ba04a58f348262ef39a4df1d5de4bd93
cat > /usr/local/etc/pkg/repos/opt-php.conf <<'EOF'
opt-php: {
url: "https://pkg.indeax.com/opt-php/${ABI}/quarterly",
signature_type: "pubkey",
pubkey: "/usr/local/etc/ssl/certs/opt-php.pub",
enabled: yes
}
EOF
pkg update
pkg install opt-php74 opt-php84
sysrc opt_php84_fpm_enable=YES && service opt_php84_fpm start
- Repository and docs: https://pkg.indeax.com/
- Build status and history: https://pkg.indeax.com/status/
- Sources: https://github.com/Indeax/opt-php
This is a personal, best-effort project with no guarantees; use it at your own risk. Old PHP branches are only as secure as the available backports. Feedback, bug reports and suggestions
are very welcome.
Many thanks to everyone who keeps old PHP branches alive with security backports and to all FreeBSD team and maintainers.