Question

I'm Trying to include or autoload Solarium for SOLR in PHP and I keep getting errors. I know I'm doing it incorrectly but I'm new to autoloading. I have the extension installed for php and that works. Here is the error I receive:

Fatal error: Class 'Solarium\Client' not found in /Users/...

Here is my php file with code I'm testing—I realize that there is no autoloading setup in my example, I'm new to autoloading confused at how to use it:

<?php

require(__DIR__.'/init.php');

// check solarium version available
echo 'Solarium library version: ' . Solarium\Client::VERSION . ' - ';
Was it helpful?

Solution

The preferred way to install Solarium is by using Composer. Solarium is available on Packagist. For more info see https://github.com/solariumphp/solarium

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top