PHP: Curl cannot capture a text page on my own site

I am trying to use curl inside php to grab a page from my own web server. The page is pretty simple, just has plain text. However, it returns "null". I can successfully get other pages in other domains and on my own server. I see this in the browser just fine, and I can grab it with the wget command line just fine, just when I try to capture one specific page with curl, it just appears null. We cannot use file_get_contents because our host is down.

Why in the world will this be a different behavior?

+3
source share
3 answers

. url , curl_init(), . curl_init, .

+2

curl user agent. "", , wget curl, , .

+1

You should check the output curl_error(), as well as view your log files for the http server.

+1
source

Source: https://habr.com/ru/post/1724661/


All Articles