diff --git a/appendices/ini.xml b/appendices/ini.xml index da6813398e..479746cb40 100644 --- a/appendices/ini.xml +++ b/appendices/ini.xml @@ -4638,6 +4638,16 @@ auto_prepend_file=security.php PATH environment variable: a list of directories separated with a colon in Unix or semicolon in Windows. + + PHP considers each entry in the include path separately when looking for + files to include. It will check the first path, and if it doesn't find + it, check the next path, until it either locates the included file or + returns with a + warning + or an error. + You may modify or set your include path at runtime using + set_include_path. + Unix include_path diff --git a/language/control-structures/include.xml b/language/control-structures/include.xml index 2f3c9f4041..2d377190f4 100644 --- a/language/control-structures/include.xml +++ b/language/control-structures/include.xml @@ -9,29 +9,25 @@ The documentation below also applies to require. - The two constructs are identical in every way except how they handle - failure. They both produce a - Warning, but require - results in a Fatal Error. - In other words, use require if you want - a missing file to halt processing of the page. include does - not behave this way, the script will continue regardless. Be sure to have an - appropriate include_path setting as well. - Be warned that parse error in included file doesn't cause processing halting - in PHP versions prior to PHP 4.3.5. Since this version, it does. - Files for including are first looked for in each include_path entry - relative to the current working directory, and then in the directory of - current script. - E.g. if your include_path - is libraries, current working directory is /www/, - you included include/a.php and there is include "b.php" - in that file, b.php is first looked in /www/libraries/ - and then in /www/include/. - If filename begins with ./ or ../, it - is looked for only in the current working directory or parent of the - current working directory, respectively. + Files are included based on the file path given or, if none is given, the + include_path specified. The + include construct will emit a + warning if it + cannot find a file; this is different behavior from require, + which will emit a + fatal error. + + + If a path is defined (full or relative), 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. + + + For more information on how PHP handles including files and the include path, + see the documentation for include_path. When a file is included, the code it contains inherits the