duanchu0031 2015-06-16 23:08 采纳率: 0%
浏览 39

来自互联网的传入CURL请求未被WAMP 2.2 Web服务器接收

I have installed a wamp server on my laptop that can be accessed locally and from internet. The domain name is educirajse.com and it points to my IP address 95.180.202.54:81. The http request are forwarded through 2 routers to my local static ip address: 192.168.1.130. My web server is accessible via browser through internet but when I try to access some scripts with CURL from another web server I receive error 28 - connect timed out. I used two different web servers and the situation is the same! The interesting thing is that CURL works locally on WAMP, for example I am able to make payments with paypal and payza via CURL from my WAMP web server, but when I try to send a CURL request from another web server to my wamp web server then I always receive connect timed out or couldn't connect to host...! I tried disabling the firewal but to no avail...! Here is an example script that fetches a web page, but unfortunately is not able to fetch my web site hosted on educirajse.com through my wamp web server! It fetches all other pages, but not the page hosted on my wamp web server and there is nothing in the error log or access log...!

So, why my WAMP server does not receive CURL request from internet, but receives them locally???

    <?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://educirajse.com:81");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_USERAGENT,"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 " );
curl_setopt($curl, CURLOPT_TIMEOUT, 100);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_VERBOSE,true);
$res=curl_exec ($curl);
var_dump( curl_getinfo($curl)) . '<br/>';
echo curl_errno($curl) . '<br/>';
echo curl_error($curl) . '<br/>';
echo $res;
curl_close ($curl);
?>
  • 写回答

1条回答 默认 最新

  • dongzhuan1185 2015-06-16 23:58
    关注

    My bet is you have a firewall built into your router OR you have not mapped the ports to point to the computer in question.

    If it is port mapping then you will need to login to your router and forward port 81 to the INTERNAL IP of the machine you wish to respond to web server requests on port 80.

    I would suggest that you state what router you are using and if you have port forwarding setup or not. Once we know what router and firmware version that router is running we can better direct you on what to do so that this problem will become a thing of the past.

    80 is also not a default port for a web server.. port 80 is the default. I would still suggest you look into your port forwarding through your router.

    I know personally at my home I have setup a static IP to my web server machine and I have forwarded Port 80 to that static IP.

    评论

报告相同问题?

悬赏问题

  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题