2012-11-05 1 views
0

팬 페이지의 페이스 북에 이미지를 업로드 할 수있는 스크립트를 코딩했는데 웹 호스팅에서 시도했지만 "realpath"에 대해 open_basedir이 비활성화되어 있으므로 사용할 수 없습니다 (로그인, Facebook 상태 업데이트 그리고 모든 것들이 완벽하게 작동합니다.) 그래서 나는 VPS에 시도, 나는이 응용 프로그램과 함께 autenticate 할 때 오류가 얻을 아파치 2.2.8 & PHP 5.2.6 만과의 appserv 설치 : 내 페이스 북 스크립트가 appserv를 사용하여 작동하지 않습니다

Warning: file_get_contents(https://graph.facebook.com/me/accounts?access_token=) [function.file-get-contents]: failed to open stream: No error in C:\AppServ\www\editor_imagenes\index.php on line 58 

Warning: Invalid argument supplied for foreach() in C:\AppServ\www\editor_imagenes\index.php on line 79 

Warning: file_get_contents(https://graph.facebook.com/me?access_token=) [function.file-get-contents]: failed to open stream: No error in C:\AppServ\www\editor_imagenes\index.php on line 106 

내가 그것을 괜찮 내 코드를 알고를 할 때 때문에 나는 잘 작동하는 webhosting 시도 ... 내가 뭘 할 수 있을까? 읽어 주셔서 감사합니다 :) 해결

+0

PHP 설정에서 allow_url_fopen이 false로 설정되어있는 것 같습니다. Btw., "수동으로"API 요청을하는 대신 PHP SDK를 사용하는 것이 강력히 권장됩니다. 훨씬 쉽고 오류가 발생하기 쉽습니다. – CBroe

답변

0

문제 :

내가이 함께 file_get_contents 교체 "GLADIUS"에 대한

if(!extension_loaded('curl') && [email protected]('curl_php5.so')) 
{ 
    return 0; 
} 

$parseurl = parse_url($token_url); 

$c = curl_init(); 
$opts = array(
CURLOPT_URL => $token_url, 
CURLOPT_RETURNTRANSFER => 1, 
CURLOPT_TIMEOUT => 10, 
CURLOPT_HTTPHEADER => array("Host: " . $parseurl['host']), 
CURLOPT_SSL_VERIFYHOST => 0, 
CURLOPT_SSL_VERIFYPEER => false 
); 
curl_setopt_array($c, $opts); 

$response = @curl_exec($c); 

덕분에, 그는 나에게 코드를 제공합니다.

관련 문제