2011-12-26 6 views
2

私はUbuntu 11.10を使用しています。Linux/phpには親ディレクトリが必要です

私のウェブサイトのルートの場所は "/ホーム/ a1a4a/www /の"

である私は/home/a1a4a/www/account/account_info.phpでPHPファイルを持っている」

私は彼をしたいこと「/home/a1a4a/www/include/fg_membersite.php」のファイルを

それは私がaccount_info.php

require_once('./include/fg_membersite.php'); 

からやったと私はこのエラーを得たものだ含ま

Warning: require_once(./include/fg_membersite.php): failed to open stream: No such file or directory in /home/a1a4a/www/account/account_info.php on line 10 Fatal error: require_once(): Failed opening required './include/fg_membersite.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/a1a4a/www/account/account_info.php on line 10 

どうしたのですか?直し方 。 私は完全な権限を持っています(sudo chown -R www-data)。

おかげで、ハッピーホリデー:)

答えて

11

常に絶対パスを使用するか、呼び出し元のスクリプトに応じて、エラーに直面するだろう。

require_once('./include/fg_membersite.php'); 

は、実際にする必要があります

require_once(dirname(dirname(__FILE__)).'/include/fg_membersite.php'); 
関連する問題