Skip to content

Chicken sausages roasted with vegetables

This is a comforting one-dish meal, perfect during cold weather. Use unsmoked, uncooked chicken apple sausages for the best effect: the apple juice adds a subtle sweetness to the surrounding veggies.

(Continued)

The joys of syndication and spam control

The Bad Behavior plugin seems to block my friends who try to syndicate this site on LiveJournal. I might need to fiddle with whitelisting.

Speaking of whitelists, why oh why are comments made by registered WordPress users being held for moderation (including myself)? This is by both Akismet spam moderation and within the built-in (I think) WordPress Awaiting Moderation tab. I wonder if I missed a setting somewhere. I had to adjust Spam Karma 2’s Filter Plugin Setting for User Level to accept logged in users, too, so I’m confused why I still need to do more comment moderation.

Then again, perhaps Akismet requires training (like email spam filters). That would be fine. Although that leaves the (current) mystery of the default Awaiting Moderation entries popping up for registered users. Will investigate, but advice welcomed!

Update: Under Options ⇒ Discussion, having “An admin must approve the comment (regardless of any matches below)” turned on is the likely culprit. Since I already have “must fill out name/email” and “must have previously approved comment” turned on, this had confused me.

Your comments about comments (and registration)

To my dear users who are so kind as to help me test this test site: Please feel free to post feedback about comments and user registration here. Muchas gracias!

Searching for a good PHP & MySQL book (Part 3)

So I think I’ve finally found a good introductory book to read and keep on my bookshelf:

PHP Solutions: Dynamic Web Design Made Easy (Powers, Friends of Ed 2006). As the title implies, this book focuses primarily on PHP. However, the author does provide an introduction to MySQL and even a little bit on Apache. I like his pragmatic style and dry humor, and also appreciate that the sample site he refers to uses valid XHTML and (separated) CSS. In fact, he makes his code snippets abstract enough to realize this smart programming practice. Powers emphasizes security matters with PHP (which is great), provides examples of an image gallery and content management system, even mentions XAMPP (but not MAMP) as an installation option. He doesn’t go into more advanced topics like PEAR or object-orient PHP (though he covers PHP Data Objects, PDO). But that’s okay. Later on I can always look for another book with more comprehensive PHP information.

In addition, David Powers has a companion site containing code and updates.

I also browsed through Sams Tech Yourself PHP, MySQL and Apache: All in One (Meloni, Sams 2006, 3rd edition). This had some useful information on Apache (although nothing on mod_security) and some good introductory material for PHP, MySQL and database design. The writing didn’t quite grab me, even though I’d say this book would come in second to the Powers’ book, compared with the others I read for getting started with PHP and MySQL.

Previous articles on “Searching for a good PHP & MySQL book”: Part 1 and Part 2.

Next time I ought to discuss JavaScript books. 🙂

Granola

I’m not a morning person, so breakfast is rarely on my top fave list. My groggy brain gravitates towards easy preparation, so pre-packaged cereals would be an easy answer. Except that I’m so picky about the ingredients: too much cinnamon, nuts that I don’t like (walnuts and pecans have no place in cereals or breads, AFAIC), and coconut where it’s not wanted. But then inspired by Deborah Madison’s recipe from Vegetarian Cooking for Everyone (Broadway, 1997), I found that homemade granola is amazingly easy!

granola with raisins, cashews & almonds

(Continued)

Searching for a good PHP & MySQL book (Part 2)

Continuing from the initial post on my search for a good PHP and MySQL book. As of this writing, though, I’m still a-searchin’… :-\

(Continued)

Searching for a good PHP & MySQL book (Part 1)

So far I’ve been more or less disappointed with the PHP and MySQL books I’ve glanced through. I try to read at least a few dozen pages in each to get an idea of the writing style and coverage. Perhaps it might be best to get separate books on PHP and MySQL? That’d be a shame, because there are so many which cover both of those topics.

What am I looking for?

  • An introduction to PHP and MySQL, rather than a cookbook. But the book can be geared towards the “advanced beginner,” if that makes any sense (i.e., I’m technically savvy but not a guru).
  • A focus on best coding practices, but also provide (and explain) examples of common mistakes and poor programming.
  • Coverage of PHP 5, including information on debugging, error messages and security. Examples using a content management system like WordPress a plus.
  • Basics of SQL and database design. Coverage of MySQL 5 preferred.
  • Platform independence, please.
  • Clear, succinct writing style. Of course.
  • Web and application resources a plus.

In any case, here are the first three books I’ve looked at.

(Continued)

testing possible WordPress bug, er, scratch that

system;

Ahem. Actually, the issue was Apache’s mod_security not allowing certain strings to be posted here. I get a 503 web server error if I sneak in a set of parenthesis () right after the word “system” and the semicolon. So to fix this, I’d need to modify the rules there via .htaccess. Or remember to use numeric character entities when posting content containing the triggering strings.

MAMP: Macintosh, Apache, MySQL & PHP

Through Michael Doig’s excellent tutorial, I recently discovered MAMP, a free package which provides recent builds of Apache, MySQL and PHP as a standalone installation on Mac. It’s geared towards local server development on a machine, as opposed to live sites, so it’s great for testing out stuff like WordPress locally.

Unfortunately, MAMP has issues. First of all, there is no documentation or even a FAQ which addresses the simple question of how to update MAMP. After taking a hint from the MAMP forums, it turned out to be rather straightforward:

  1. Stop the servers; I did this via the MAMP widget.
  2. Backup /Applications/MAMP/htdocs/ —basically any web content that you have added or changed.
  3. Backup /Applications/MAMP/db/ —your database(s). MySQL instructions: Actually, don’t backup the default /Applications/MAMP/db/mysql/mysql/ or /Applications/MAMP/db/mysql/test/ folders, which are usually updated. Only backup the other folders and files under /Applications/MAMP/db/mysql/ which are specific to your installation.
  4. Backup other folders you had added to /Applications/MAMP/, such as a Gallery 2 data folder.
  5. Replace /Applications/MAMP/ with the newer version.
  6. Replace the content and database folders with the ones you had saved in steps 2 through 4.
  7. Uninstall the previous MAMP Dashboard widget, then install the newer version (which is located in /Applications/MAMP/). Apply any widget fixes (see below).
  8. Restart the servers, again via the MAMP widget.

Ah, and the other problem: The “Open Start Page” in the MAMP widget doesn’t do anything. (The Start Page does open if I launch MAMP.app, oddly.) I found a helpful fix at gaarf.info, where you edit mampwidget.js (in the Mamp Control widget package contents) to correct a preference file reference. Using your favorite text editor, go to line 90:

var startPage = widget.system("/usr/bin/defaults read com.webEdition.MAMP
startPage",null).outputString.replace(/[\r\n]/,"");

Change com.webEdition.MAMP to com.living-e.MAMP. Start Dashboard, hit the Manage Widgets (+) button, remove the MAMP widget (tick its ‘x’ button), then re-add it from the Manage Widgets strip. Restart servers, and the Open Start Page button now works. Whew.

I hope the MAMP folks can fix these simple issues of documentation and the widget. It’s a shame their forums seem to be plagued with spam (at least the English ones), too, which makes finding answers a bit slow.

Update (6-Nov-2006): Thanks to Holger Meyer for answering my email about upgrading!

Update (22-Feb-2007): The latest 1.5-beta1 still has the Start Page bug with the Dashboard widget. Gallery 2 and some of the WordPress plugins no longer seem to work. 🙁

Update (8-May-2007): MAMP 1.6 came out, and still has the Start Page bug with the Dashboard widget. The download now includes both the free and Pro versions of MAMP. Gallery 2 stoutly refused to run (blank page issue), but the workaround was easy: In the php.ini configuration file, increase memory_limit from 8MB to 16MB. While Gallery will run when given 12MB, the WPG2 plugin won’t work (no random image in Sidebar), unless memory_limit is set to at least 16MB.

Update (17-July-2007): Was noodling around the MAMP website and noticed that version 1.6.1 was released on 11 April 2007. Likely a typo in the date, since the files have a timestamp of 15 May 2007. The widget bug seems to be fixed at least (enfin!). The packages listed on the releases page are the same between 1.6 and 1.6.1. It’s a shame, though, that MAMP hasn’t had a more recent, thorough update to include the latest Apache, MySQL, PHP and phpMyAdmin bits (compare with the newer packages in XAMPP for OS X, a less mature OS X server bundle). You’d think they’d do that to keep the paid MAMP Pro version up to date.

Cream of Mushroom Soup

I enjoy a good creamy mushroom soup, preferably not from a can. The secret here is sautéing the mushrooms so that they become browned and aromatic. The addition of wine, almonds and thyme make the soup so rich and tasty for me that cream is optional.

(Continued)