0

ローカル マシンで実行するサイトがあります。OSX を使用している場合、これらの行は問題ありません。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/' );

これがエラーです

致命的なエラー: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/') C:\wamp\www\emporio-rossi\wapp\conf.inc.php の 33 行目

Propel.php は最初の URI ( set_include_path ( get_include_path () . ':' . dirname ( __FILE__ ) . '/../lib/propel/runtime/lib/' );)にあります。

4

1 に答える 1

2

Windows は;パス区切りとして使用しますが、nix (OSX を含む) は を使用し:ます。

答えはPATH_SEPARATOR定数を使用することです:

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

ドキュメントから:

PATH_SEPARATOR 定数を使用すると、オペレーティング システムに関係なくインクルード パスを拡張できます。

于 2014-01-16T15:24:04.303 に答える