file_get_contents yasak 403 döndürür

0 Cevap php

I am trying to make a sitescraper. I made it on my local machine and it works very fine there. When I execute the same on my server, it shows a 403 forbidden error. I am using the PHP Simple HTML DOM Parser. The error I get on the server is this:

Warning: file_get_contents(http://example.com/viewProperty.html?id=7715888) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/scraping/simple_html_dom.php on line 40

Bunu tetikleyen kod satırı:

$url="http://www.example.com/viewProperty.html?id=".$id;

$html=file_get_html($url);

Ben sunucuda php.ini kontrol ve allow_url_fopen Açık. Olası çözüm curl kullanarak olabilir, ama ben yanlış gidiyorum bilmek gerekir.

0 Cevap