0

I've installed solarium with composer using below commands in ubuntu:

php composer.phar require solarium/solarium

I've also used silex micro framework. After installing solarium, when I tried to run sample php file in examples folder, I got error

"Fatal error: Class 'Solarium\Client' not found in  
/api/vendor/solarium/solarium/examples/1.1-check-solarium-and-ping.php on line 7"

How to get this work as expected? I want to use both silex and solarium in a project.

VMAtm
  • 27,943
  • 17
  • 79
  • 125
Guru
  • 410
  • 1
  • 7
  • 17
  • did you include the /vendor/autoload.php file? – Matiss Jul 20 '15 at 11:12
  • 2
    In that case you should debug where the Solarium/Client is defined and see composer generated autoload files in /vendor/composer whether this class is present. Nothing much we can help you with here. – Matiss Jul 20 '15 at 11:15
  • Maybe it's because solarium use PSR-0 autoloader which is deprecated. You need proper configuration to fit PSR-4 autlooad. You can also use solarium autloader and include it in your project – Robert Jul 20 '15 at 11:47
  • There is no namespace 'Solarium' added at autoload_namespaces.php. Now i've added "'Solarium\\' => array($vendorDir . '/solarium/solarium/library'),". Now it is working fine. – Guru Jul 20 '15 at 12:01

0 Answers0