php fsockopen is NOT working
我正在尝试使用特定查询信息 ping 域。
这应该非常简单,但它不起作用。
所以…为什么这么简单的 fsockopen php 命令不起作用?!
1
|
fsockopen(‘http://www.domain.com/test?q=https://example.com’, 80);
|
警告:fsockopen() [function.fsockopen]: 无法连接到 http://www.domain.com/test?q=https://example.com:80 (无法找到套接字传输” http” – 您在配置 PHP 时是否忘记启用它?) 在 …
- 你为什么要为 http 使用套接字?如果您只需要远程 http 功能(具有用于更改标头和内容的大量功能),请尝试使用 php cURL。 (php.net/manual/en/book.curl.php)
-
是的!我已将其更改为 cUrl。完美运行!谢谢 :)
fsockopen 只接受主机名。
-
请使用 cURL 库
-
或简单的 file_get_contents 函数
- 是的 ! file_get_contents 超级简单,工作完美! :) 谢谢 !
来源:https://www.codenong.com/23033471/
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_8786.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57