简体   繁体   English

PhantomJS 408错误“套接字操作超时”

[英]PhantomJS 408 error “Socket operation timed out”

I'm getting this error when trying to open a webpage that is on the same server as the PhantomJS code. 尝试打开与PhantomJS代码在同一服务器上的网页时,我收到此错误。 PhantomJS can open any other webpage (ssl or not) but won't open any webpage that is on my server. PhantomJS可以打开任何其他网页(ssl与否),但不会打开我服务器上的任何网页。 I always get this error and there is very little information, actually none, what "Socket operation timed out" means for PhantomJS. 我总是得到这个错误并且信息非常少,实际上没有,“套接字操作超时”对PhantomJS意味着什么。

I'm running CentOS 6.6 and PhantomJS 1.9.8. 我正在运行CentOS 6.6和PhantomJS 1.9.8。 I tried a few PhantomJS versions already, including the latest 2.1.1 and I'm getting the same error. 我已经尝试了几个PhantomJS版本,包括最新的2.1.1版本,我得到了同样的错误。

The dev version of my app runs perfectly on Ubuntu 14.04 but doesn't seem to work on my production server. 我的应用程序的开发版在Ubuntu 14.04上完美运行,但似乎不能在我的生产服务器上运行。

I did have some luck opening webpages on this server working from another server (remote access, essentially). 我确实有幸在这台服务器上打开了从另一台服务器(远程访问,基本上)工作的网页。

Is there anything on my server (that is just running Wordpress) that can be blocking PhantomJS? 我的服务器上有什么东西(只是运行Wordpress)可以阻止PhantomJS吗? The only thing I can think of is the fact I have SSL installed, but non-SSL pages also don't work. 我唯一能想到的是我安装了SSL,但非SSL页面也不起作用。

I've tried command line and both php-phantomjs and wkhtmlpdf and always get a 408 error, unless I try another webpage that has a different IP address (google etc). 我已经尝试过命令行以及php-phantomjs和wkhtmlpdf并且总是得到408错误,除非我尝试另一个具有不同IP地址的网页(谷歌等)。

Any clue on what might be the problem? 关于可能出现什么问题的任何线索?

In my case i try to get page as picture with phantomjs on same machine. 在我的情况下,我尝试在同一台机器上使用phantomjs将页面作为图片。 I put 127.0.0.1 mysite.app in /etc/hosts. 我把127.0.0.1 mysite.app放在/ etc / hosts中。 I am running laravel homestead. 我正在跑laravel宅基地。

I try all possible combination of options with 1.9, at the end I have realised that there is something wrong with version 1.9, because when I have switched to version 2.1.1 status 408 gone and everything forks fine. 我尝试了1.9的所有可能的选项组合,最后我意识到版本1.9有问题,因为当我切换到版本2.1.1状态408消失了,一切都很好。

尝试更改PhantomJS使用的默认用户代理

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

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