helloworlder
helloworlder

Reputation: 1373

Confused about include_path in php.ini

I have this line in php.ini

include_path = ".;C:\xampp\htdocs\zend\library;C:\xampp\php\PEAR"

What exactly is the . in front of the string?

And what does the line do, exactly? I know it includes the paths, but what exactly happens behind the scenes? Maybe this is a dumb question but I'm asking anyway :-)

Upvotes: 1

Views: 707

Answers (2)

Jan Hančič
Jan Hančič

Reputation: 53930

. adds the current working path to the include path

What all this does is that if you say:

Include ( 'some_file.php' );

PHP will look for that file in the directories specified in the "include_path". It will look in the order you specify the directories.

Upvotes: 4

John Parker
John Parker

Reputation: 54415

The '.' is used to denote the current working directory of the script.

In terms of the general purpose of the line, it basically tells PHP where to look for files when you use an require or include statement (or a variation thereof such as the usually more useful require_once or include_once).

Upvotes: 2

Related Questions