FIX #1866 Environment file finder logic

Fixing the logic that searches for environment files so that warnings
due to open_basedir are suppressed and both the 'realdir' and the server
path are spidered for the environment file.

Fixing issue #1866