I’m happy to announce the first official release of xLog!
![]()
xLog is a PHP extension that allows extended logging of PHP errors, including Fatal errors. Output typically includes referral, GET values, URL, and a full backtrace. Additional information can be included via custom variables by the developer at runtime. xLog is derived from similar code used for the last couple years at Facebook for faster debugging by developers. It’s finally reached the point where I believe it’s ready to take the next step into the Open Source community so it can grow even more and benefit a larger group of people. I often forget that other developers don’t get full backtraces for all their PHP errors, so I hope that in the next year everyone else feels the same way! Please contact me with any problems, suggestions, or other feedback! Read more and download it on the xLog page.
A new patch for including response counters in the apache mod_status page is now available here.
This patch provides extra counters to mod_status that list different response codes and their counts since server start, along with the ability to clear stats. Useful for monitoring tools and notifications.
I’ve made available an experimental patch I was working on for Apache to cache file stat calls. Unfortunately it’s not very useful, but I’m posting it online in it peaks someone’s interest or perhaps finds another use.
One great thing to optimize out of any system is system calls, and especially any system call that access i/o or disk. In an attempt to exclude all stat calls from the Apache/PHP/APC stack, I created an Apache file stat cache that would cache all the stat calls in memory and never repeat a stat call…. As it turns out this patch isn’t really that useful, as the gains are pretty marginal if at all, and typically you’ll have heavier performance bottlenecks in PHP code than the one stat call that Apache is going to do per request… (full page here)
I’ve updated the Apache Source Defense patch to correctly match extensions. Prior to these changes any file that contained a ‘.php’ extension would be included, such as .php.txt etc. I’ve now corrected this so it will only match the last extension in a file. If you are currently using this and expect it to protect against these situations, please add additional extensions to the patch to make sure you’re protected (I hold no liability for this not working as advertised). If you run across any problem, bugs, missing features please let me know.
I’ve added some updates to the XDebug connect back patch. This now includes a fix for JIT with the latest version of XDebug from Lucas. I’ve also added a fix for a segfault when running from the commandline or when REMOTE_ADDR isn’t available.
It’s often the case that I want to run a ‘make test’ on some PHP extension I’m installing as a dynamic .so file. This often fails, as the PHP INI configuration is still read from the normal places except that the .so path is changed to match that of the extension I’m working on. This means that there are possibly a lot of unecessary errors regarding PHP’s inability to load missing extensions or trying to load the same extension twice. The work around for this is really simple, but probably not obvious. I discovered this a while back in an email thread to internals (thanks Marcus), but recently forgot about it until a co-worker brought up the issue for me again. If you do run into this your best solution is going to be setting the environment variable TEST_PHP_ARGS=-n. ie: ‘env TEST_PHP_ARGS=-n make test‘.
Thanks to some feedback from Luke Weber I’ve now *correctly* updated the PHP FatMM patches so they’ll actually compile ;-). It sounds like this saved him about 6%, which is less than I expected but nothing to be ashamed of either. Interested to hear other peoples experiences with this if they’re brave enough to try it out!
The Zend Fat MM patches have been updated to support setting an environment variable, ZEND_FATMM, to control the size of the pre-allocated memory size. The memory size setting can now also be set to 0 to effectively disable the Fat Memory Manager. I also wanted to be able to control these settings from the Apache configuration directive SetEnv in the env module. This, however, won’t work under PHP in it’s current form as SetEnv doesn’t actually set the system environment variables. To work around this I’ve also created a new directive, SetSysEnv, which enables users to control actual environment variables from within Apache configurations. This is useful for setting things like ZEND_FATMM, as well as the other environment variables in the Zend memory manager. Enjoy and drop me some feedback.
I finally got to go to Kabuki theatre since they’ve remodeled specifically for the purpose of trying out their reserved seating. The theatre looks fantastic, and the staff is great too. They have automated ticket machines where you can reserve your seat, or you can reserve them online before you go to the theatre. There’s a nice bar upstairs, a coffee bar, and seating to lounge around in until the appointed time of your movie arrives.
I didn’t try the bar this time, (gotta save something for next time), but I think it’s definitely worth the drive to go to a theatre like this. There’s a sur-charge for the assigned seating in addition to standard movie prices, but I’m tired of paying high prices to wait in lines and fight for seats, aren’t you?
On the recommendation of Terry I recently finished reading The Omnivore’s Dilemma. I thought it was a wonderful read, part way through the first chapter I realized that I had just read about corn for the last hour or so and was completely enthralled. It takes some skill to take something as mundane as the history and evolution of corn and make it into an enthralling experience. Beware, however, that this book will likely change the way you think about you meal not necessarily in the typical to eat meat or not to eat meat. This books goes much further than that, and regardless of you’re dietary beliefs, this book will appeal to everyone’s sense of taste. I found the logic very realistic in it’s expectations and at the same time critical of every detail that goes into the creation of a meal. I highly recommend this for anyone who cares about what they put in there body.