简体   繁体   English

致命错误:require_once():无法打开所需的file.php

[英]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/' );

From the docs : 来自文档

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.

相关问题 PHP致命错误:require_once():必须打开失败 - PHP Fatal error: require_once(): Failed opening required PHP致命错误:require_once():必须打开失败 - PHP Fatal error: require_once(): Failed opening required 获取 PHP 错误“致命错误:require_once() 需要打开失败<file> ”</file> - Getting PHP error “Fatal error: require_once() Failed opening required <file>” htaccess和php_value include_path-致命错误:require_once():无法打开所需文件 - htaccess and php_value include_path - Fatal error: require_once(): Failed opening required file 警告:require_once(../initialize.php):无法打开 stream 和致命错误:require_once():无法打开所需的问题 - Warning: require_once(../initialize.php): failed to open stream and Fatal error: require_once(): Failed opening required problem 致命错误:require_once():需要打开失败 - Fatal error: require_once(): Failed opening required 致命错误:require_once():需要打开失败 - Fatal error: require_once(): Failed opening required 致命错误:require_once():需要打开失败 - Fatal error: require_once(): Failed opening required 致命错误:require_once():XAMPP中要求打开失败 - Fatal error: require_once(): Failed opening required in XAMPP Codeigniter 新手:致命错误:require_once():需要打开失败 - Codeigniter for newbie : Fatal error: require_once(): Failed opening required
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM