PHP include does not allow ../

apache-2.2PHP

Installed apache and PHP on a new server. Using include("blah.php"); works fine but it doesn't work when I try to include from the directory behind, include("../blah.php");

PHP.ini has both:
allow_url_fopen = On
allow_url_include = On

Does anyone know what is causing this?

Best Answer

According to the documentation

If a path is defined — whether absolute (starting with a drive letter or \ on Windows, or / on Unix/Linux systems) or relative to the current directory (starting with . or ..) — the include_path will be ignored altogether. For example, if a filename begins with ../, the parser will look in the parent directory to find the requested file.

When you include ("blah.php"); PHP uses the include_path, but if you use a relative specifier, like . or .., PHP builds a path relative to where it is, i.e. the currently executing script.