zendframework include 设置 index.php中的:
set_include_path('.'.PATH_SEPARATOR.'./library/'.PATH_SEPARATOR.'./application/models/'.PATH_SEPARATOR.get_include_path());
PATH_SEPARATOR是一个常量,在Linux系统中是一个" : "号,Windows上是一个";"号。所以编写程序时最好用常量 PATH_SEPARATOR 代替,否则如果系统从linux移植到win系统或反过来移植会出错!
get_include_path取得当前已有的环境变量,加上前面的设置就是新的系统include_path
如何查看当前web系统的include_path呢?
打开php配置文件php.ini,找到如下图所示部分:
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;D:\web\ZendFramework1.11\library\Zend"