Drupal 7 clean URLs

I have today off from work, so I’ve been sitting around at home, messing with Drupal.
I couldn’t quite figure out how to get clean URLs to work, until I stumbled across this article. (See the “post-installation tips” section at the end.) Pretty simple really, and I should have been able to figure it out on my own, if I’d read as far as the RewriteBase section of the main clean URLs article on drupal.org.

I also went a bit nuts at www.packtpub.com today. They are running a special, 5 ebooks for $60, so I bought four Drupal books and one PHP book. I’m building up a bit of a library of ebooks that I’ve bought on sale, mostly from O’Reilly.  I never seem to have time to read them though!

Drupal 7

After staying out too late Tuesday night, then going to bed at 8:30pm last night, I finally had some free time after work tonight to play around with Drupal. I installed Drupal 7 on my MacBook, following these instructions. The only real trouble I had was in making sure that every host reference was set to 127.0.0.1 rather than localhost, or anything else.

Most of the obvious stuff seems to be working.  I haven’t figured out clean URLs yet though.

xAMP on the Mac

I’ve been trying to learn a bit about Drupal recently. It looks like we might be getting some Drupal projects at work, so it seemed like a good idea.

To get a working setup for Drupal on my Mac, I wanted to get all the pieces in place — Apache, PHP, and MySQL, basically. Apache is, of course, already there, and I already had that turned on, so no problem.

PHP was already installed, but apparently got turned off during the 10.7 upgrade. All you need to do to turn it on is edit httpd.conf, and uncomment one line, per this SO page.

For MySQL, there’s an installer that works pretty smoothly, per this page. One odd thing I stumbled across at one point is that you usually need to refer to your local server as ‘127.0.0.1’ rather than ‘localhost’. Long story, but something worth noting. Also, if you’re not sure how to set the root password, take a look at this SO page.

I tested to make sure that MySQL was working from PHP using this little test script:

<?php

$db = mysql_connect("127.0.0.1:3306", "root", "password");

if (!$db) {
    die('Could not connect' . mysql_error());
}
    echo 'Connected successfully';
?>

I can’t remember exactly where I found that, but it’s a pretty basic script.

I then got a little ambitious and decided to try to get phpMyAdmin working. I made a couple of simple mistakes here, including not quite understanding that config.inc.php needed to be in the root phpMyAdmin folder and not in the config subfolder.

Also, the warning from phpMyAdmin about mcrypt not being installed was bugging me, so I decided to try and fix that. That turned out to be kind of complicated. I followed these instructions, and they worked, but only on my second try. I must have gotten something wrong on the first try. Also, I found another page with similar instructions, so referencing that may help if anything on the first page seems confusing.

In the end, I think I really should have just gone with MAMP, but of course I was doing this as a learning exercise, so it was valuable to go through all this, even if it took a lot longer than was probably necessary.

And I still don’t have Drupal installed. Maybe tomorrow!

digital comics

I just spend $38 on $76 worth of digital comics from Dark Horse.  I had a 50% off coupon, good even on stuff that was already on sale. I now have nearly all the Hellboy and BPRD comics that came out since i stopped buying them regularly in 2009. Plus the first 16 issues of The Goon, which I’ve wanted to read, but never got around to buying. A little over 50 comics total.  Digital comics never seem worthwhile to me when they’re priced at close to the regular print cover price, but for less than $1 each, they’re not a bad deal.