I've now been using PHP for over 12 years, and over that time I've learnt a lot of lessons, many of them the hard way, about building good web applications that scale, and some of the relatively easy and cheap things you can do to avoid pain later on.