You are browsing a read-only backup copy of Wikitech. The live site can be found at

PHP packaging

From Wikitech-static
Revision as of 20:04, 12 November 2021 by imported>Legoktm (fix)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

We currently use modified Debian packages to install PHP on appservers and in Docker images. These packages are available from in a dedicated component for others to use, like CI and MediaWiki-Vagrant.

Differences from Debian

Aside from custom patches we want to apply, the packages are slightly different. Starting with PHP 7.4, all packages are named php7.4-foo (instead of the versionless php-foo). This is implemented by patching dh-php:

In an extension package, the binary package name also needs to be changed, including any potential dependencies. Any php-foo.* files also need to be renamed to php7.4-foo.*

Initial forking

If you want to fork a new package from Debian, clone the Git repository from Salsa, adjust the packaging as explained above, and build the package:

$ https_proxy="http://webproxy:8080" gbp clone
$ cd php-pcov/
$ git checkout debian/bullseye
$ git checkout -b wikimedia/php74
$ # Make changes to the debian/ directory
$ # Add a changelog entry with +wmf1~buster1 appended to the version
$ PHP74="yes" gbp buildpackage --git-debian-branch=wikimedia/php74 --git-dist=buster-wikimedia -sa

Modifying a package

If you need to patch or modify a package already in our repository, use the latest .dsc to create a new Git repo. You can find the URL of the .dsc by looking in the pool.

$ gbp import-dsc --allow-unauthenticated 
$ cd php-pcov
$ # Make your changes, bump changelog
$ PHP74="yes" gbp buildpackage --git-dist=buster-wikimedia