Posted over 8 years ago. Visible to the public.

Lighttpd, newrelic php and per directory settings.

If you are using lighttpd to host several php applications via virtual hosts and are using the newrelic php monitoring service then you'll have noticed that setting the php application name per virtual host does not seem possible at first.

I was able to workaround the problem by using the pecl htscanner package. It scans for .htaccess files in your applications directory and imports their settings into you php application.

  1. install the htscanner extension (usually something like sudo pecl install htscanner)
  2. configure the extension
  3. restart lighttpd
  4. create an .htaccess file in your virtual hosts directories

Example .htaccess

php_value newrelic.appname ""

Example htscanner configuration

This file usually goes to /etc/php5/conf.d/htscanner.ini:

[htscanner] extension="" config_file=".htaccess" default_docroot="/" default_ttl=300 stop_on_error = 0 verbose = 0

Owner of this card:

Last edit:
over 8 years ago
Posted by jan0sch to jan0sch's deck
This website uses short-lived cookies to improve usability.
Accept or learn more