Archive for the 'Bluehost' Category

Ruby to PHP

I’ve been porting the BYUFHLC to PHP, and it’s coming along pretty well in spite of a number of mini-setbacks. The only tricky part was figuring out how to parse the HTML from the screenscrape. At first I was going to use Troy Wolf’s class_http, but it didn’t seem to have any functions for actually doing anything with the HTML once it was fetched. Then I discovered the new DOM stuff in PHP 5.

Excitedly coding up a few lines to test it, I ran into function-not-found errors. Ten minutes later, I realized that Bluehost’s servers were running PHP 4. (Side note: I’d tried to get PHP running locally on my Mac, but it wasn’t serving the PHP; instead it would just display them as plain text.) I called them up and they said it’d take a 24-hour downtime to migrate my domains over to the PHP 5 server. That was unacceptable.

So, I went hunting around in /etc/httpd/httpd.conf again, and I found a line reading “<IfModule mod_php4.c>”. Changed the ‘4′ to a ‘5′ and it all started working perfectly.

After that, it only took twenty or thirty minutes to convert my Ruby code to PHP, and I’ve got the first set of results working perfectly. But now my stomach is grumbling because I haven’t eaten in a long time, so finishing this up is going to have to wait till tomorrow. I’m glad it’s going to be a fairly easy port. (From here on out it’s smooth sailing, since I’ve worked out all the DOM issues.) Expect another status report tomorrow.

And no, I’m not converting to PHP. :) I love Ruby and will continue to use it whenever possible.

Mephisto on Bluehost

Stumbled across Mephisto today. It’s a Rails-based blogging system, and dang does it look good. ~drool~ I am pleased with WordPress, mind you, and it’s treated me well, but I’d really really really love to blog on a Rails blogging app so I could tweak things in Ruby instead of PHP. I like what little I’ve seen of Mephisto, too.

I’m not sure if I’ll be able to install it on my servers, though, because you have to be running Edge Rails (revision 4727), and Bluehost has 1.1.6. Nor do I think they’d upgrade their servers just for me. :) Beyond that, it helps if you can install gems, but I can’t. Time to post to the forums

The other thing is that this is a project I can actually see myself contributing to. WordPress could have got a few lines of PHP out of me, but coding Ruby for Mephisto would be quite fun. If I can get it installed, the first thing I’m going to write is a WordPress-to-Mephisto converter so I can move all my blogs over.