php default include path

The default include path in php is “.:/usr/share/pear:/usr/share/php”(3 directories). You can change the include path by the include_path=”” option in php.ini. Note that the directories are  separated by colon  in Linux and semicolon in Windows. When you use include or include_once, or require/require_once for a file with relative path, php will look up the file in the include path. Of course, if you include absolute path, php won’t bother to look up the file in the include path.

You can use get_include_path to get current include path. You can use set_include_path to change the include path. What doe get_include_path do in php? Well, you may want to put your php scripts that are required by all php projects in the include path so that you need not specify the absolute directory every time you include them. Note that the include path is restricted by the open_basedir directive. You need to add the include paths to the value of open_basedir in order to access them.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Leave a Reply