无法通过php连接到last.fm api

无法通过php连接到last.fm api,php,api,last.fm,Php,Api,Last.fm,我正在尝试使用从下载的软件包通过php连接到Last.fm api。 这是我的密码: public function getTopArtists($methodVars) { // Check for required variables if ( !empty($methodVars['user']) ) { $vars = array( 'method' => 'user.gettopartists',

我正在尝试使用从下载的软件包通过php连接到Last.fm api。 这是我的密码:

      public function getTopArtists($methodVars) {
    // Check for required variables
    if ( !empty($methodVars['user']) ) {
        $vars = array(
            'method' => 'user.gettopartists',
            'api_key' => $this->auth->apiKey
        );
        $vars = array_merge($vars, $methodVars);

        if ( $call = $this->apiGetCall($vars) ) {
            if ( count($call->topartists->artist) > 0 ) {
                $i = 0;
                foreach ( $call->topartists->artist as $artist ) {
                    $topartists[$i]['name'] = (string) $artist->name;
                    $topartists[$i]['rank'] = (string) $artist['rank'];
                    $topartists[$i]['playcount'] = (string) $artist->playcount;
                    $topartists[$i]['mbid'] = (string) $artist->mbid;
                    $topartists[$i]['url'] = (string) $artist->url;
                    $topartists[$i]['streamable'] = (string) $artist->streamable;
                    $topartists[$i]['images']['small'] = (string) $artist->image[0];
                    $topartists[$i]['images']['medium'] = (string) $artist->image[1];
                    $topartists[$i]['images']['large'] = (string) $artist->image[2];
                    $i++;
                }

                return $topartists;
            }
            else {
                $this->handleError(90, 'This user has no top artists');
                return FALSE;
            }
        }
        else {
            return FALSE;
        }
    }
    else {
        // Give a 91 error if incorrect variables are used
        $this->handleError(91, 'You must include artist variable in the call for this method');
        return FALSE;
    }
}
但当我尝试执行相同的操作时,我得到一条消息: 错误99-无法建立连接,因为目标计算机主动拒绝连接