简体   繁体   中英

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 can open any other webpage (ssl or not) but won't open any webpage that is on my server. I always get this error and there is very little information, actually none, what "Socket operation timed out" means for PhantomJS.

I'm running CentOS 6.6 and PhantomJS 1.9.8. I tried a few PhantomJS versions already, including the latest 2.1.1 and I'm getting the same error.

The dev version of my app runs perfectly on Ubuntu 14.04 but doesn't seem to work on my production server.

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? The only thing I can think of is the fact I have SSL installed, but non-SSL pages also don't work.

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).

Any clue on what might be the problem?

In my case i try to get page as picture with phantomjs on same machine. I put 127.0.0.1 mysite.app in /etc/hosts. I am running laravel homestead.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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