Php - Include PATH (Search Path)

Card Puncher Data Processing

About

The include_path parameter specifies a list of directories where the:

  • require,
  • include,
  • fopen(),
  • file(),
  • readfile()
  • and file_get_contents()

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

  • with a colon in Unix
include_path=".:/php/includes"
  • semicolon in Windows.
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





Discover More
Pear Ini Windows Permissions
Php - PEAR (PHP Extension and Application Repository) - Package Manager

PEAR is a framework and distribution system for reusable PHP components. See The PEAR package manager can: install packages create new packages, manage a registry of installed packages, check...
Idea Php Include Path
Php - PhpUnit

Unit test Framwork Get the phar file for your php version. See Requirement Powershell bash Load from include_path. You need to set it for Idea....



Share this page:
Follow us:
Task Runner