views:

129

answers:

2

I want to add my PHP library file to be included in include_path, so that i can access it from anywhere in my application running on that server. I tried adding it as per the syntax for include_path in php.ini But its not working. I tried get_ini("include_path"); and got the value perfectly. But my functions are not inlcuded in my applications.

A: 

The include_path directive defines folders where PHP is looking for files that are being included using include() or its siblings. The only benefit is that you don't need the whole path (like include '/path/to/my/include/file.php'), but the file name only (include 'file.php')

soulmerge
+1  A: 

use set_include_path(get_include_path().PATH_SEPARATOR.'your_new_dir_path');

Don