1

I've installed PhantomJS and PHP-PhantomJS per the PHP-PhantomJS docs.

Per the PHP-PhantomJS docs, I have the following lines at the top of a php file:

use JonnyW\PhantomJs\Client;
$client = Client::getInstance();

When executing $client = Client::getInstance();, I get the error:

'JonnyW\PhantomJs\Client' not found

The installer has placed JonnyW\PhantomJs\Client here:

/Applications/myWebApp/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Client.php

The script that contains the "use" command is located here:

/Applications/myWebApp/application/controllers/myPHPscript.php

How can I modify the "use" command so as to locate the required "JonnyW\PhantomJs\Client" file?

I have looked at StackOverflow topics that appear similar but don't seem to provide the answer I need.

Thanks in advance to all for any info.

VikR
  • 4,818
  • 8
  • 51
  • 96

1 Answers1

0

As noted, I followed the PHP-PhantomJS Docs in installing PhantomJS and PHP-PhantomJS. Per those docs, I used Composer to download and install everything. I'd never used Composer before. I learned that the framework I'm using, CodeIgniter, includes support for Composer. All I had to do was activate Composer support in the CodeIgniter config.php file, via the $config['composer_autoload'] setting.

VikR
  • 4,818
  • 8
  • 51
  • 96