use*_*841 2 php server-side-includes include-path
我有几个独立的网站,住在不同的目录中.对于他们共同的包含,我将它生活在其他人居住的根目录中.
user@hostname:/var/www$ ls
website_1 website_2 website_3 common_files
Run Code Online (Sandbox Code Playgroud)
我想包含一个Zend包,所以我有我的包含路径
ini_set("include_path", get_include_path() . ":/var/www/common_files/Zend");
require_once("Mail.php");
Run Code Online (Sandbox Code Playgroud)
Mail.php 加载好了,但是那里的某个地方就是这条线
require_once 'Zend/Mail/Transport/Abstract.php';
Run Code Online (Sandbox Code Playgroud)
这给出了这个错误
Warning: require_once(Zend/Mail/Transport/Abstract.php): failed to open stream: No such file or directory in var/www/common_files/Zend/Mail.php on line 26
Run Code Online (Sandbox Code Playgroud)
所以php不会递归地进入包含路径的目录结构.我是否必须将Zend移动到每个网站目录中,拼出每个包含的路径,或者什么?
BTW摘要确实存在:
user@host:/var/www/common_files/Zend$ tree -d
...
`-- Mail/Transport
|-- Mail/Transport/Abstract.php
|-- Mail/Transport/Exception.php
|-- Mail/Transport/Sendmail.php
`-- Mail/Transport/Smtp.php
9 directories, 32 files
Run Code Online (Sandbox Code Playgroud)