Apparently, mapserver works much better if the permissions are set correctly on the shapefiles to be queried. That could perhaps be why $layer->open() wasn't working correctly. Sorry to waste your time all! -Camden