在include_path中添加我的自定义PHP库

sat*_*ish 2 php include-path

我想添加我的PHP库文件以包含在include_path中,以便我可以从在该服务器上运行的应用程序中的任何位置访问它.我尝试按照php.ini中include_path的语法添加它但它不起作用.我试过get_ini("include_path"); 并且完美地获得了价值.但我的功能在我的应用程序中没有包含.

Don*_*Don 7

你可以尝试使用

set_include_path(get_include_path().PATH_SEPARATOR.'your_new_dir_path');
Run Code Online (Sandbox Code Playgroud)