php - 使用 PHP 的 Http 空响应

标签 php apache http curl

我这里有个大麻烦。随机地,我的服务器开始不从我的 PHP 文件返回任何缓冲区。我的意思是,我访问 somefile.php,然后我在系统中做了一些事情,当我再次尝试访问 somefile.php 时,我突然收到了一个ERR_EMPTY RESPONSE(在浏览器中)。

我已经在所有浏览器中试过了。一样。当我要求其他人在不同的机器上访问同一个文件时,一切正常,但在我的机器上,我仍然看到错误。所以我决定在页面中做一个 cURL 请求,看看发生了什么,结果如下。

使用以下代码:

<?php
$ch = curl_init("http://192.168.1.15/curiaonline/projetobase/paroquialogada.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, true);
?>

我得到了:

HTTP/1.1 200 OK
Date: Tue, 16 Jun 2015 20:41:59 GMT
Server: Apache/2.4.9 (Win64) PHP/5.5.12
X-Powered-By: PHP/5.5.12
Content-Length: 7
Connection: close
Content-Type: text/html

hy test"
* Hostname was NOT found in DNS cache
*   Trying 192.168.1.15...
* Connected to 192.168.1.15 (192.168.1.15) port 80 (#0)
> POST /curiaonline/projetobase/paroquialogada.php HTTP/1.1
Host: 192.168.1.15
Accept: */*
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue

< HTTP/1.1 200 OK
< Date: Tue, 16 Jun 2015 20:41:59 GMT
< Server: Apache/2.4.9 (Win64) PHP/5.5.12
< X-Powered-By: PHP/5.5.12
< Content-Length: 7
< Connection: close
< Content-Type: text/html
< 
* Closing connection 0

然后我将 CURLOPT_POST 更改为 FALSE 我得到了:

* Hostname was NOT found in DNS cache
*   Trying 192.168.1.15...
* Connected to 192.168.1.15 (192.168.1.15) port 80 (#0)
> GET /curiaonline/projetobase/paroquialogada.php HTTP/1.1
Host: 192.168.1.15
Accept: */*

* Empty reply from server
* Connection #0 to host 192.168.1.15 left intact

paroquialogada.php 文件只包含“hy test”。

我已经试过了:

  • 禁用我的防火墙
  • 禁用服务器防火墙
  • 在 PHP 错误日志中搜索错误
  • 在 Apache 错误日志中搜索错误
  • 清理我的 DNS 缓存
  • 更新我的 Windows 连接

最佳答案

我发现了问题。我必须使用网上银行的安全软件来访问我的帐户,因为我是巴西银行的客户. GAS Tecnologia 提供的此软件将 chrome 请求视为病毒,并阻止来自 Windows 服务器的响应。任何有可能出现问题并使用网上银行的人,只需禁用此软件即可。

关于php - 使用 PHP 的 Http 空响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30877902/

相关文章:

php - 在选择选项标签中循环 Ajax 响应

php - 从表单设置 session 变量

apache - 在 k8s 上安全地运行 apache 容器

django - apache中test.example.com到example.com的重定向问题

php - Symfony + Mercure 连接问题。使用 HTTPS 而不是 HTTP

php - 有关 sql 和字符串的帮助

Apache 覆盖 500 个 HTTP 状态代码响应

angular - 如何使用 RxJs 处理/排队多个相同的 http 请求?

http - Mockjax HTTP 错误代码

java - 如何进行服务器端 HTTP 重定向而不是元刷新