PHP error pages

From Wikitech

The wmerrors PHP extension displays pretty fatal error pages for PHP and let Wikimedia log a stack trace whenever it happens.

What lives where

Configuration
/etc/php5/conf.d/wmerrors.ini on every Apache. Maintained in puppet.
Error page
the displayed error page is maintained in operations/mediawiki-config.git and is named php-fatal-error.html in . It is pulled on the deployment host and synced to Apaches as /apache/common/php-fatal-error.html
Log collector
udprec runs on fenari as nobody, listens on port 8421, writes to /var/log/mw/fatal.log
Warning Warning: Most probably no more use that mechanism hashar (talk) 13:52, 19 June 2013 (UTC)[reply]
    • TODO: how is this collector managed?

How to ...

update the source code

$ git clone ssh://gerrit.wikimedia.org:29418/mediawiki/php/wmerrors.git
$ cd wmerrors

// Edit package2.xml for new release

# pecl package package2.xml

Upload wmerrors-<version>.tgz to /home/wikipedia/src/pecl

Warning Warning: I guess that use a debian package now hashar (talk) 13:52, 19 June 2013 (UTC)[reply]

install

  • pecl install /home/wikipedia/src/pecl/wmerrors-<version>.tgz
  • apache-stop ; sleep 3 ; apache-start

Using OS packaging would be a real headache for our mixed cluster, PECL's source-based distribution system is much simpler.

update the error page

The file is maintained in mediawiki/php/wmerrors.git repository under the name php-fatal-error.html. Simply make your changes there and deploy the file.