Here's how to set up a development environment on http://sb.massmind.com. These steps are similar to what you would do locally as well.
See also Compiling PHP4 on Development box