简体   繁体   English

HTTP_Request调用在浏览器中有效,在Web应用程序中超时

[英]HTTP_Request call works in browser, timeout in web app

I have a web application which gets data from itself via a REST API in JSON format. 我有一个Web应用程序,该应用程序通过JSON格式的REST API从自身获取数据。 I am in the process of moving this site to a new server on a new host. 我正在将该站点移至新主机上的新服务器。 I have everything moved, same database, same files. 我把所有东西都移动了,相同的数据库,相同的文件。 The main differences would be that PHP is running as a module on the new server instead of FastCGI and the new host has a client-configurable-firewall. 主要区别在于,PHP在新服务器而不是FastCGI上作为模块运行,并且新主机具有客户端可配置防火墙。

The web app makes the API call by using Pear's HTTP_Request object (GET method). 该网络应用使用Pear的HTTP_Request对象(GET方法)进行API调用。 When I run the web app that makes the call, it spins until it finally returns a "Connection timed out" error. 当我运行发出呼叫的Web应用程序时,它将旋转直到最终返回“连接超时”错误。

However, if I echo the URL being used by the call and then hit that directly in my browser it returns all the JSON data instantly. 但是,如果我回呼该调用使用的URL,然后直接在浏览器中将其命中,它将立即返回所有JSON数据。

I am wondering if this could be a firewall issue: port or protocol used by the guts of Pear's HTTP_Request object blocked? 我想知道这是否可能是防火墙问题:Pear的HTTP_Request对象胆量所使用的端口或协议被阻止了吗? (There is currently a firewall policy allowing traffic on port 80 from any IP). (当前存在防火墙策略,允许来自任何IP的端口80上的流量)。

Or a permission issue: PHP running as a module is more sensitive to this. 或权限问题:作为模块运行的PHP对此更敏感。

Any ideas would be greatly appreciated! 任何想法将不胜感激!

As the new server is still only being tested using the IP address, the internal web application was attempting to access itself via an external IP. 由于新服务器仍仅使用IP地址进行测试,因此内部Web应用程序正尝试通过外部IP访问自身。 From the server itself, the external IP is not available. 从服务器本身,外部IP不可用。 It has to be changed to point to the internal network IP for testing. 必须更改它以指向内部网络IP进行测试。

Once the domain name is moved this will become a non-issue again. 域名一旦移动,将不再成为问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM