3

Although phantomjs has a disk-cache option that works when running via command line, when I use php-phantomjs no disk caching is created.
Is there any specific setting I should set on PHP or Apache so that php-phantomjs uses disk-cache?

1 Answer 1

1

Think I found out how to answer my own question:

  1. Make sure that Apache user's home is writable by the user running Apache, or at least that $HOME/.qws is writable by that user.
  2. Set $HOME enviroment variable on PHP script:
    $apacheUserData = posix_getpwuid(posix_getuid()); putenv('HOME='.$apacheUserData['dir']);

With the above steps phantomjs binary running from PHP knows how to find Apache's user dir and is also able to write to $HOME/.qws.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.