koali

Archive for the ‘php’ Category

XAMPP and skype

Friday, February 12th, 2010

If you load skype before turning on your apache server, you will notice that it won’t load. Doing a port check shows that skype is listening on port 80.
Two easy fixes:
1. Quit skype and load xammp and then reload skype
OR
2. Change the port xammp is listening on

Regular expression to find <? instead of <?php

Wednesday, February 10th, 2010

So I was getting “Parse Error: syntax error, unexpected $end filename on line linenum” In a wordpress plugin. The file was working correctly on my live server but not on xampp and the line number was the last line of the file. A bit of googling searching pointed me to the issue being a mixture of <? and <?php.

So if you come across the issue, and don’t want to manually search through your 2000 line file to find the offending tag, the following regular expression will find those naughty <? tags
<?[^p]

Handy info for staging wordpress sites

Wednesday, February 10th, 2010

When setting up a wordpress site, I’ll usually develop it in a staging environment and then deploy it live. In the past i’ve been manually changing the database as per the instructions I found a couple of years ago. I decided to see if there was an easier solution and there is.
WordPress has information on changing the site url

In other wordpress tips, Xammp lite is fantastic for setting up a small little dev site locally.

Lesson learnt

Sunday, February 8th, 2009

So I decided this morning to ‘quickly’ update my guild’s forum. The computer hamsters knew that I didn’t have all day to play with the website!!!!

Anyway… If you are going to update a phpbb3 forum, set the theme back to one of the default ones before you do so!

I couldn’t get into the admin section, post or do  anything but read! Turns out our old theme of .2 versions ago doesn’t work now :s

Image resize problem

Sunday, November 9th, 2008

I have a script for my band’s website that automattically generates an xml file, resized images and thumbnail images from a folder of original photos. Recently it has been giving me some trouble by just cutting out.

This is the culprit…
@imagecreatefromjpeg($origDir.”/”.$file);

Turns out that some embedded meta data from cameras stuffs up the function. I hadn’t encountered it till recently, when I was uploading other people’s photos. The fix for me now is just to run all functions through a fireworks batch process to save off new jpgs, which seems to strip the info out. Will have to find a better solution later.