YOURLS, Part 2

Posted on March 7, 2010
Filed Under Fuzzy Thought | Leave a Comment

OK, so it’s been a little longer than I thought it would be, but at least I’m getting around to finishing up the post about YOURLS. Half the time in the past, I’d say I’d write more about something, and then never do. If you haven’t read my intro blurb about it, you might want to, although it doesn’t really matter if you do or not.

The install process was easy, just download and unzip the zipped file, and upload it to the server. Create the database, and edit & rename the config file with the correct information.  Run the install script, and that was it. Using it to create a shortened URL was easy too, just fill in the url, hit OK, and out came a short url.

The only place I ran into trouble was viewing the stats, and having the shortened url bring me to the site. After working on it for a bit, I figured something must have been wrong, so I deleted everything and started again. It still didn’t work, so I had to figure out where the issue was. Eventually I narrowed it down to a specific item, but couldn’t figure out why I was having an issue. After doing a few other things to see if it worked, I chatted with my host for a bit, and he was able to figure out the issue:  some GeoIP methods were already compiled into the PHP set up, so it was trying to redeclare them in YOURLS. Since error reporting is apparently suppressed in YOURLS, I wasn’t being shown the errors. (Aside: it looks like they reworked something in the latest version, because an PHP parse error did show up when I updated today.)

However, my host knows what he is doing, and knew how to get around that. And I learned something new that day: while ssh’d in, just do php filename.php, and watch it spit out the errors. So after that, he just wrapped the functions with a check to ignore if they were already defined, and everything worked fine.

One of the main reasons I chose YOURLS is that there is also a WordPress plugin that when you create a new post (and/or page, if you so desire) will automagically shorten the post’s url, and post it to your twitter account. Now, sometimes I’m not a fan of those things, especially when people do a lot of posts a day, or in a short time span. That’s not me though, and I’m lucky if I write one post a week; I figure the people following me on twitter can survive the one extra tweet per week, especially since I don’t tweet all that often.

If people are looking for a url shortener that they wish to use themselves, I would recommend YOURLS, especially if the person uses a self-hosted installation of WordPress.

Comments

Leave a Reply