私は完全な PHP/wamp 初心者ですが、簡単なコードを動作させようとしています。私はライブラリを使用して Twitter の OAuth を支援しており、Windows で wamp を使用してコードを作成およびテストしています。
これは私のコードです:
<html>
<body>
<?php
include 'tmhOAuth.php';
include 'tmhUtilities.php';
$tweet_text = 'Test Tweet. If you can see this, my PHP code is working! Yay';
echo "Posting...\n";
$result = post_tweet($tweet_text);
echo "Response code: " . $result . "\n";
function post_tweet($tweet_text) {
$connection = new tmhOAuth(array(
'consumer_key' => 'xxxxxxxxxx',
'consumer_secret' => 'xxxxxxxxxxxx',
'user_token' => 'xxxxxxxxxxxxxxxxx',
'user_secret' => 'xxxxxxxxxxxxxx',
));
$connection->request('POST',
$connection->url('1/statuses/update'),
array('status' => $tweet_text));
return $connection->response['code'];
}
?>
</body>
</html>
そして、私が得るエラーメッセージ: Fatal error: Call to undefined function curl_init() in C:\wamp\www\PHP\tmhOAuth.php on line 581 tmhOAuth は、私が使用しているライブラリファイルの 1 つです。
簡単な Google の後、次のチュートリアルに従い ました: http://www.phpmind.com/blog/2011/02/how-to-enable-curl-in-wamp/、curl に関する行のコメントを外しました。また、私が見つけた別のチュートリアルの指示に従って、ext フォルダー内の php_curl.dll を別のバージョンのファイルに置き換えました。
助けてください