John Don John Don - 28 days ago 10
PHP Question

An established connection was aborted by the software in your host machine Windows 8.1

I am trying to create an HTTP request to read the URL, and this code was working fine 15 days back, but now it's not working.

<?php
$source_url = 'https://www.facebook.com/stepblogging';

$rest_url = "http://api.facebook.com/restserver.php?method=links.getStats&urls=" . urlencode($source_url);
$xml_response = file_get_contents($rest_url);
$xml_record = simplexml_load_string($xml_response);

$fb_share_count = $xml_record->link_stat->share_count;
$fb_like_count = $xml_record->link_stat->like_count;
$fb_comment_count = $xml_record->link_stat->comment_count;
$fb_total = $xml_record->link_stat->total_count;
echo 'Facebook Share:' . $fb_share_count . '<br/>';
echo 'Facebook Like:' . $fb_like_count . '<br/>';
echo 'Facebook Comment:' . $fb_comment_count . '<br/>';


After running this code, the output is:


Notice: file_get_contents(): send of 103 bytes failed with errno=10053 An established connection was aborted by the software in your host machine. in E:\workspace\php\htdocs\connectivity\fbcount2.php on line 4

Notice: file_get_contents(): send of 24 bytes failed with errno=10053 An established connection was aborted by the software in your host machine. in E:\workspace\php\htdocs\connectivity\fbcount2.php on line 4

Notice: file_get_contents(): send of 2 bytes failed with errno=10053 An established connection was aborted by the software in your host machine. in E:\workspace\php\htdocs\connectivity\fbcount2.php on line 4


I am new to PHP. Please help me.

Answer

Actually, I found the answer by my own. This error was because of the k9 software, so I uninstalled it, and now there is no error regarding connection establishing. If anyone is getting this error, he/she should uninstall the software such as Skype, k9 (protocol using software) type of software.