I recently moved a bunch of PHP files into a new directory, and thus had to change the paths for my require_once() functions. The issue with relative paths is that if File A loads a File B, and File B resides in a different directory, File B tries to look for required files relative to File A.
The solution is to use absolute paths. Yagudaev has an excellent article showing a couple of different solutions for getting the absolute path you want. Here’s an example of what I did:
require_once ('../queries.php'); require_once (dirname(__FILE__) . '/../queries.php');