By Matt Butcher
January 2010
OS X: Installing MongoDB and the PHP Mongo Driver
Submitted by matt on Sat, 2010-01-30 11:09MongoDB is a full-featured object database. Since it is fast, versatile, and schema-less, you can develop a very complex data storage layer without an ORM, and without any tedious coding. For this reason, I have been investigating MongoDB as a storage layer for PHP. Here's how to set up an environment on OS X Snow Leopard.
In this blog we'll do the following:
- Install MongoDB
- Add some initial data to MongoDB
- Install the PHP PECL driver for MongoDB
- Write a short PHP Script that uses MongoDB
- Shut down the MongoDB server
OpenAmplify Drupal Series: Part 2 - Building a Mini Portal
Submitted by matt on Wed, 2010-01-27 21:30The Second in my three-part series on Drupal an OpenAmplify has been published on their community site. If you missed the first part, you may want to start there. Part three, coming soon, will cover the API, and will focus on development instead of configuration.
Part 2
In part two, I walk through the process of building a "mini portal" by taking semantic information returned from an OpenAmplify analysis of a node, and using that information in conjunction with other web services. For this demonstration, I released a new version of the module, and added support for Shopping.Com and Bloglines, both of which can return some impressively rich content.
QueryPath on WebMonkey
Submitted by matt on Tue, 2010-01-19 09:03It just came to my attention that a WebMonkey article (Parsing HTML? There's an App for That) from a few months ago suggested using QueryPath as an alternative to attempting to parse HTML by hand.
Appropriately, last week I wrote a QueryPath script to analyze a site and extract all links so that I could feed them to Siege and simulate something like a real load against a server. It's nice to be able to easily extract data from HTML.
OS X: Using curl instead of wget
Submitted by matt on Fri, 2010-01-15 10:21OS X does not come with wget, a command-line tool for retrieving websites. For a while, I grumbled about this. I knew that curl was installed, but I hadn't ever used curl from the command line. But once I tried it out, I realized that for my needs, curl is just as good as wget... and I don't have to install anything extra to get it.
Here's how to use curl to fetch a remote URL:
$ curl -OL h ttp://spine-health.com/index.php
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 34646 0 34646 0 0 15314 0 --:--:-- 0:00:02 --:--:-- 17767This will download the remote file and store it locally in index.php. If you leave off the -O, it will write the file to standard output (your terminal, usually).
curl: Remote file name has no length!
Fetching from a URL's root can behave differently. If you perform the same command as above, but pointing to the base URL, you will get an error:
$ curl -OL h ttp://spine-health.com/ curl: Remote file name has no length! curl: try 'curl --help' or 'curl --manual' for more information
What's going on here? The error is not terribly informative on this point. The problem is that curl doesn't know where to write the output file. A better command here is something like this:
$ curl -L h ttp://spine-health.com/ > out.html
This time, the retrieved data will be written to the out.html file.
Like wget, curl has many options. You can read the man page for details, or you can get a quick summary with the usual curl --help command.
OpenAmplify Drupal Series: Part 1 - The Amplify Module
Submitted by matt on Wed, 2010-01-13 20:33Over at OpenAmplify's Community site, they are running Part 1 of a three-part series I've written about using OpenAmplify with Drupal.
Open Amplify
The first part covers the basics of using Acquia Drupal and the Amplify module to perform semantic analysis of your content.
Nagios: Fixing "error: Could not stat() command file" (on Debian)
Submitted by matt on Wed, 2010-01-13 10:24Nagios is a network monitoring tool. I use it to track web servers, mail servers, and whatever else I have running on the LAN and on the Internet.
One common configuration issue is getting the Service Commands menu to work correctly. By default, it is visible in the UI, but disabled on the server backend. And on Debian, not all of the steps to enable it are particularly evident from the docs. Often, one will recieve the cryptic error Could not stat() command file pointing to /var/lib/nagios3/rw/nagios.cmd. This can be fixed without too much fuss.
Nagios Service Commands
Acquia Webinar: "Playing Nicely with Others"
Submitted by matt on Wed, 2010-01-06 09:57In our webinar Playing Nicely With Others: Integrating Drupal with Third-Party Data, Ken, George, Larry, and I talk about integrating various web services with Drupal. We talk about SOAP, content importing, digital asset management systems, and QueryPath (surprisingly, I'm not the one plugging QueryPath in this vid).
Thanks to Acquia for doing a fantastic job putting together their webinar series.
Fortissimo and Pilaster: Two projects
Submitted by matt on Mon, 2010-01-04 21:40I have released two projects today:
- Fortissimo: A PHP framework with a twist. It's scalable, it's not MVC, it's fast, and it's NSFW!
- Pilaster: A pure PHP document database that provides similar services to MongoDB or CouchDB -- only without the server.
Both are still under heavy development, but they are now at the point where others can start testing them and playing with them.









Recent comments
23 hours 32 min ago
1 day 23 hours ago
2 days 9 hours ago
2 days 9 hours ago
3 days 16 hours ago
4 days 11 hours ago
5 days 12 hours ago
6 days 8 hours ago
1 week 2 days ago
2 weeks 23 hours ago