2011-06-27 10 views
0

を取得しています、私はTwitterのログインアプリケーションに取り組んでいますはなぜPHPのエラーに

config.phpは次のとおりです。

//My modification of Abraham's Config specifically for calling variables from the Question2Answer DB 

////// First establish base directory for app 
define('QA_BASE_DIR', dirname(empty($_SERVER['SCRIPT_FILENAME']) ? __FILE__ : $_SERVER['SCRIPT_FILENAME']).'/../../'); 
$qainc=$_SERVER['DOCUMENT_ROOT'] . '/qa-include'; 

////// Require the qa-base.php 
require $qainc. '/qa-base.php'; 

////// Require the qa-db, connect to the db, and provide a fail handler 
////// As Adam Savage says "Failure is Always an Option" 
require $qainc. '/qa-db.php'; 
$failhandler ='Database Connection Failure';  
$connect=qa_db_connect($failhandler); 

//////Get the variables for the Twitter Details 
$TW_CALLBACK_URL=qa_opt('TW_CALLBACK_URL'); 
$TW_CONSUMER_KEY=qa_opt('TW_CONSUMER_KEY'); 
$TW_CONSUMER_SECRET=qa_opt('TW_CONSUMER_SECRET'); 
$TW_OAUTH_TOKEN=qa_opt('TW_OAUTH_TOKEN'); 
$TW_OAUTH_SECRET=qa_opt('TW_OAUTH_SECRET'); 

//////Define the variables 
define('CONSUMER_KEY', "$TW_CONSUMER_KEY"); 
define('CONSUMER_SECRET', "$TW_CONSUMER_SECRET"); 
define('OAUTH_CALLBACK', "$TW_CALLBACK_URL"); 
define('oauth_token',"$TW_OAUTH_TOKEN"); 
define('oauth_secret',"$TW_OAUTH_SECRET"); 

しかし、私はこのエラーを取得しています:

Warning: require() [function.require]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/qa-include/qa-base.php) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a7820858/public_html/qa-plugin/twitter-oauth-login/config.php on line 22 


PHP Error Message 

Warning: require(/usr/local/apache/htdocs/qa-include/qa-base.php) [function.require]: failed to open stream: Operation not permitted in /home/a7820858/public_html/qa-plugin/twitter-oauth-login/config.php on line 22 

PHP Error Message 

Fatal error: require() [function.require]: Failed opening required '/usr/local/apache/htdocs/qa-include/qa-base.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a7820858/public_html/qa-plugin/twitter-oauth-login/config.php on line 22 

私のディレクトリ構造は、これらが含まれていますフォルダ:

qa-plugin/twitter-oauth-login/some files 

答えて

0

あなたのopen_basedirのために、あなたのルートの外にphpファイルを含めることはできません。この設定を変更するか、QA_BASE_DIRが現在ある場所に移動してください。

0

open_basedirで指定されたディレクトリに存在しないファイルを含めることを試みています。

/home/にすべてを移動するか、/usr/local/apache/htdocs/open_basedirに追加してください。

0

open_basedirという制限は、PHPがツリー内のファイルにアクセスすることを制限します。インクルードしようとしているファイルはおそらくそのツリーの外にありますか?

関連する問題