PHP file_get_contents does not work on localhost

前端 未结 7 1221
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 21:48

I am working on my website from localhost (http://172.16.65.1/) a MAMP server on OSX.
I want to load some JSON from Google and some simple tests show me I have a probl

7条回答
  •  粉色の甜心
    2020-12-01 22:22

    For me the problem was that file_get_contents didn't work on https://domain.test.loc (domain that resolves to localhost), but worked on http://domain.test.loc. Maybe it doesn't like the self-signed certificate. I do have allow_url_fopen set to ON and extension = php_openssl.dll.

提交回复
热议问题