PHPinclude_path设置技巧分享

PHPinclude_path设置技巧分享
1.include_path的意义

当功能包括()、()的要求,fopen_with_path()函数来查找文件。在include_path情况不设置,默认的函数打开一个文件是在根目录下找到网页。当设置include_path,PHP的功能将在下面指定的include_path目录搜索。

其原理类似于窗口系统的环境变量。当窗口运行CMD命令时,输入一些CMD命令,然后系统将搜索这些命令是否存在于其一组环境变量中,并且可以执行该命令。

对2.include_path设置
第一种方法:

在php.ini文件中修改include_path项目。

include_path =: / usr / / / PHP本地库: /包括。
第二方法:

使用ini_set方法。
ini_set(include_path

三.注意
ZendFramework包括集合index.php

复制代码代码如下所示:
set_include_path。path_separator。'/图书馆/ '('。
。path_separator。。 / / /模型中的应用
。path_separator。。 / / / lib中的应用
path_separator.get_include_path());

path_separator是恒定的,在Linux系统中,一个;在Windows。

所以要写一个程序的最好方法就是用不断的path_separator,否则如果系统移植Linux到Win系统或反过来,迁移会出错!
get_include_path获取当前环境变量,加上设置新的系统包括

tag:分享设置技巧电脑软件PHPinclude_path

相关内容