Search code examples
phpphp-phantomjs

PHP PhantomJS causing 408 Timeout response if page is re-executed after previously already run


I am working on a project which uses PHP Phantom JS.

It seems to work once, but they if I try and re-run the script again to regenerate the PDF I then get a 408 HTTP status saying it timed out (it didn't actually timeout its my local PC).

If I wait for a little while, and try again it will work, but again, if I then try and re-execute straight away I get the 408 response again.

I'm wondering if its something to do with it taking a little longer to reload the file handle to the PDF that was created or some other resource hasn't quite been cleaned up? This is purely a guess.


Solution

  • I found the problem, I've increased the timeout, I originally thought the number was in seconds, so I put 120 but didn't seem to make a huge difference, looking at the source code, its actually in miliseconds so made it 120000 and now it seems to be working.