我正在嘗試創建一個小型Facebook應用程序。在我的php文件中,我編寫了代碼來顯示我的名字並獲取我朋友的列表。這是我的代碼:php_network_getaddresses:嘗試創建Facebook應用程序時getaddrinfo失敗錯誤
<?php
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\"></fb:name>!</p>";
echo "<p>Friends:";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
echo "<br>$friend";
}
echo "</p>";
?>
這是輸出我得到:
Hello, Angeline Aarthi!
Friends:
Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed:
No such host is known. in C:\Documents and Settings\256148\My Documents\ide\xampplite\htdocs\facebookApp\facebookapi_php5_restlib.php on line 1755
Warning: fopen(http://api.facebook.com/restserver.php) [function.fopen]:
failed to open stream: php_network_getaddresses: getaddrinfo failed:
No such host is known. in C:\Documents and Settings\256148\My Documents\ide\xampplite\htdocs\facebookApp\facebookapi_php5_restlib.php on line 1755
Warning: array_slice() expects parameter 1 to be array, string given in C:\Documents and Settings\256148\My Documents\ide\xampplite\htdocs\facebookApp\index.php on line 29
Warning: Invalid argument supplied for foreach() in C:\Documents and Settings\256148\My Documents\ide\xampplite\htdocs\facebookApp\index.php on line 30
請人幫我解決我的錯誤。
問題出在php.ini文件中的擴展路徑不正確。因此,必要的dll文件沒有加載。所以我得到錯誤消息。現在解決了。 – Angeline 2010-07-01 13:03:36
我有一個類似的問題,你能指定哪些必要的DLL沒有被加載? – Drew 2011-09-22 23:26:33