This could be a permissions problem preventing the getcwd() command from returning the correct path.
from the getcwd() manual page
"On some Unix variants, getcwd() will return FALSE if any one of the parent directories does not have the readable or search mode set, even if the current directory does. See chmod() for more information on modes and permissions. "
what do you get if you add the following code to a blank php page:
<?php echo("The Current Working Directory is: ".getcwd().""); ?>