[英]Fatal error: require_once(): Failed opening required file.php
I've a site that runs on my local machine. 我有一个在我的本地机器上运行的网站。 These rows are ok when I'm on OSX.
当我在OSX上时,这些行是可以的。 While on windows generates errors:
在Windows上生成错误:
set_include_path ( get_include_path () . ':' . dirname ( __FILE__ ) . '/../lib/propel/runtime/lib/' );
set_include_path ( get_include_path () . ':' . dirname ( __FILE__ ) . '/../lib/smarty/libs/' );
set_include_path ( get_include_path () . ':' . dirname ( __FILE__ ) . '/../classes/' );
set_include_path ( get_include_path () . ':' . dirname ( __FILE__ ) . '/../classes/ORM/' );
This is the error 这是错误
Fatal error: require_once(): Failed opening required 'Propel.php' (include_path='.:C:/wamp/www/emporio-rossi/conf/:C:\\wamp\\www\\emporio-rossi\\wapp/../lib/propel/runtime/lib/:C:\\wamp\\www\\emporio-rossi\\wapp/../lib/smarty/libs/:C:\\wamp\\www\\emporio-rossi\\wapp/../classes/:C:\\wamp\\www\\emporio-rossi\\wapp/../classes/ORM/') in C:\\wamp\\www\\emporio-rossi\\wapp\\conf.inc.php on line 33
致命错误:require_once():无法打开所需的'Propel.php'(include_path =':C:/ wamp / www / emporio-rossi / conf /:C:\\ wamp \\ www \\ emporio-rossi \\ wapp / .. /lib/propel/runtime/lib/:C:\\wamp\\www\\emporio-rossi\\wapp/../lib/smarty/libs/:C:\\wamp\\www\\emporio-rossi\\wapp/../classes /:C:\\wamp\\www\\emporio-rossi\\wapp/../classes/ORM/')在第33行的C:\\ wamp \\ www \\ emporio-rossi \\ wapp \\ conf.inc.php
Propel.php is located in the firs URI ( set_include_path ( get_include_path () . ':' . dirname ( __FILE__ ) . '/../lib/propel/runtime/lib/' );
) Propel.php位于第一个URI(
set_include_path ( get_include_path () . ':' . dirname ( __FILE__ ) . '/../lib/propel/runtime/lib/' );
)
Windows uses ;
Windows使用
;
as a path separator whereas nix (including OSX) uses :
. 作为路径分隔符,而nix(包括OSX)使用
:
。
The answer is to use the PATH_SEPARATOR
constant: 答案是使用
PATH_SEPARATOR
常量:
set_include_path ( get_include_path () . PATH_SEPARATOR . dirname ( __FILE__ ) . '/../lib/propel/runtime/lib/' );
Making use of the PATH_SEPARATOR constant, it is possible to extend the include path regardless of the operating system.
利用PATH_SEPARATOR常量,无论操作系统如何,都可以扩展包含路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.