So as the title says I get - HTTP/1.1 500 Internal Server Error on file_get_contents Here is error log -
! ) Warning: file_get_contents(http://thepilotslife.com/assets/chat-output.php): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\wamp\www\test\index.php on line 3
The URL http://thepilotslife.com/assets/chat-output.php opens well in borwser, try opening yourself, try reloading the URL in browser every 5 sec you will not that the out put is diffrent every time, so I basically need to fetch data from that URL and then perform certain task on it. This is the php file content -
<?php
$baseurl = "http://thepilotslife.com/assets/chat-output.php";
$response = file_get_contents($baseurl);
echo $response;
?>
I tried using CURL too in the following manner
<?
$url = "http://thepilotslife.com/assets/chat-output.php";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
echo $curl_scraped_page;
?>
The above CURL code do not give any error but it only gives me a blank page every time.. I used var_dump in CURL code too it showed that string is empty every time. I also googled and tried other solution but none worked.
EDIT : For some people the link is giving error even on browser but working fine for me so here is pic of link for reference https://i.stack.imgur.com/VM09P.png
Also note that file_get_contents and CURL are working perfectly with other links