php-wmerrors
php-wmerrors is a PHP extension that extends how PHP errors are handled and displayed. It is specifically designed for situations where the standard PHP API is not sufficient for userland code to render an error page and log stacktraces (e.g. out of memory errors). More technical details can be found in T187147#4298721 (last evaluated in 2018 for PHP 7.1+).
Service at WMF
Configuration
Error page:
The bulk of the logic is in the php-wmerrors extension. At runtime, we inject the php7-fatal-error.php (maintained in Puppet) which defines the HTML template, and takes care of the stats counter and normalized ingestion to Logstash, synthetising a message under type:mediawiki AND channel:exception
, structured the same way as uncaught exceptions that userland code in MediaWiki is able to report directly.
Appservers:
- puppet: profile::mediawiki::php (install packages, set and create runtime files, set and create INI file)
- puppet: mediawiki::web::yaml_defs (pass runtime file contents as YAML to k8s builder)
mw-on-k8s (ref T288851)
- deployment-charts: mediawiki/templates/lamp/deployment.yaml (materialize runtime files)
- docker-images: php/7.2/fpm-multiversion-base/conf/wmerrors.ini (set and create INI file, duplicated from puppet)
Deployment
For the official Pecl packages, refer to How to PECL on mediawiki.org.
For production, refer to Debian Packaging.