2014-01-16 97 views
0

我有一個網站在我的本地機器上運行。當我在OSX上時,這些行是可以的。而在窗口生成錯誤:致命錯誤:require_once():無法打開所需的文件.php

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

這是錯誤

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

Propel.php位於URI(set_include_path (get_include_path() . ':' . dirname (__FILE__) . '/../lib/propel/runtime/lib/');

回答

2

Windows使用;作爲路徑分隔而尼克斯的冷杉(包括OSX)使用:

答案是使用PATH_SEPARATOR常數:

set_include_path (get_include_path() . PATH_SEPARATOR . dirname (__FILE__) . '/../lib/propel/runtime/lib/'); 

the docs

Making use of the PATH_SEPARATOR constant, it is possible to extend the include path regardless of the operating system.

+0

微指令... :) T優! –

相關問題