The Quick & Dirty:

  • 9+ years in the biz, 10 messing around
  • All the latest in HTML, CSS, JS & PHP (Sorry, no .net or Ruby skills yet)
  • Cross-browser compatible code from Photoshop or Illustrator files.. or napkins!
  • Custom Specialities in Wordpress theming & plugins, Twitter & jQuery
  • Subversion, server-log analysis, and blocking hack-attempts (of late).
  • Data/Project Geek. I ♥ timelines.

I’ve compiled some handy PHP functions I’ve had to whip up. More extensive code-samples are also available.


Wordpress-from-static HTML


When htaccess is not working

So I’ve got an Apache2.4 server running. Having set “AllowOverrides All” in the only Directory block, I assumed the htaccess files were working. Not so. The Directory block I am using  has a regex in it. Apache2 documentation says that regex’d directories are matched last. Turns out the default Directory section in the /etc/apache2/apache.conf was matching – before the regex, and that has an AllowOverrides None.

Switching that default (scary!), got Apache to recognize the .htaccess files – and I knew this because all the sites went down. Can’t win.

Commenting out the various php_value lines solved the problem. The culprit was formatted as correctly as I know: php_value newrelic.appname “” yet Apache error logs said “Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration.”

Random Google-ing found this from TigerTech:

However, our servers run PHP in “CGI mode” as recommended by the PHP developers (not as an Apache module), so you can’t use “php_value” or “php_flag” commands in .htaccess files. If you try to do so, you’ll see an “internal server error” message.

Looks like FastCGI/php5-fpm is sufficiently CGI (read: external to apache configs) and has this problem. Some have suggested installing both php-module and fastcgi. That sounds crazy though.

In the end, NewRelic isn’t to blame – they have a whole section on FPM. Looks like I get to play with pools!


Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
Posted in Day Job, debian, devOps, LAMP, PHP Leave a comment

Leave a Reply

You must be logged in to post a comment.