Table of Contents

Php - Include PATH (Search Path)

About

The include_path parameter specifies a list of directories where the:

functions look for files.

Syntax

The format is like the system's file PATH environment variable: a list of directories with the os path separator. ie

include_path=".:/php/includes"
include_path=".;/php/includes"

Set

Programmatically

set_include_path(get_include_path().PATH_SEPARATOR."/path/to/my/file");
ini_set('include_path', '/usr/lib/pear');

Ini

The value of the include path is defined in php.ini

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
include_path=D:\xampp\php\pear
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path

Documentation / Reference