Avoid using streams in realpath() for Zend compatibility