开发者

Adding my custom PHP Library in include_path

I want to add my PHP library file to be included in include_path, so th开发者_C百科at 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.


You can try using

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


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')

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜