|
| 1 | +# PHP |
| 2 | + |
| 3 | +There are two ways to install PHP packages with XBPS: |
| 4 | + |
| 5 | +1. Using the versioned packages (recommended). |
| 6 | +2. Using the meta-packages. |
| 7 | + |
| 8 | +## Versioned PHP Packages |
| 9 | + |
| 10 | +It is generally recommended to use versioned PHP packages (e.g. `php8.1`, |
| 11 | +`php8.1-apcu`, etc.) for most use cases as this ensures a consistent environment |
| 12 | +on updates with minimal or no intervention required. |
| 13 | + |
| 14 | +## PHP Meta-packages |
| 15 | + |
| 16 | +In Void, the `php` package is a meta-package that points to the latest upstream |
| 17 | +PHP version. This convention is followed by all packages prefixed with `php-`, |
| 18 | +such as `php-fpm`, as well as `xdebug` and `composer`. See [the `php` |
| 19 | +template](https://github.com/void-linux/void-packages/blob/master/srcpkgs/php/template) |
| 20 | +for a complete list. It is recommended to only use these meta-packages for |
| 21 | +development purposes. |
| 22 | + |
| 23 | +When using a PHP meta-package, be warned that updating may require manual |
| 24 | +intervention if a new major PHP version has been added to the repository. As a |
| 25 | +part of the version change, the configuration location will change to reflect |
| 26 | +the new version. For example, upgrading from 8.0 to 8.1 would result in the |
| 27 | +configuration path changing from `/etc/php8.0` to `/etc/php8.1`. Any |
| 28 | +customizations that have been made need to be manually applied to the new |
| 29 | +configuration directory. |
| 30 | + |
| 31 | +`php-fpm` updates require special care since they include a runit service. In |
| 32 | +this case, ensure that the new runit service is started and that applications |
| 33 | +using the previous version of `php-fpm` can access the new `php-fpm` instance. |
| 34 | +In particular, make sure any applications accessing the FPM instance have the |
| 35 | +correct TCP/unix socket address. |
0 commit comments