Reputation: 83
I'm trying to get Solarium running on Centos 6.5 with an rpm install of PHP (5.3.3) and Apache HTTPD.
I have followed the instructions on the website, creating a folder /var/www/php (which is in the include path in php.ini) and downloading composer. Then I've entered the following into composer.json:
{
"require": {
"solarium/solarium": "3.*"
}
}
and run "php composer.phar install".
I am now trying to run the examples in the Solarium examples folder (specifically the 1.1 Solr Ping example). To do this I have amended init.php to include the line:
require('vendor/autoload.php');
I have confirmed that vendor/autoload.php is being run by adding a print statement to it.
However, when I run the example I get:
Fatal error: Class 'Solarium_Version' not found in /var/www/html/test/1.1-check-solarium-and-ping.php on line 7
or if I comment out line 7:
Fatal error: Class 'Solarium_Client' not found in /var/www/html/test/1.1-check-solarium-and-ping.php on line 10
So it seems that the Solarium files are not being loaded as intended.
Not sure if this is a Solarium or Composer problem (I suspect the latter). Can any one suggest a way to debug this?
Issuing the command "php composer.phar dump-autoload" only generates the message:
Generating autoload files
Is that correct (I assume not based on the description of the command)?
Running:
php composer.phar diagnose
Gives: Checking composer.json: FAIL name : is missing and it is required description : is missing and it is required No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license. Checking platform settings: FAIL
Your PHP (5.3.3) is quite old, upgrading to PHP 5.3.4 or higher is recommended.
Composer works with 5.3.2+ for most people, but there might be edge case issues.
Checking git settings: OK
Checking http connectivity: OK
Checking disk free space: OK
Checking composer version: FAIL
Your are not running the latest version
None of which look fatal. Is that correct?
Many thanks
Paul
UPDATE:
Some more info. Adding some print statements to vendor/composer/autoload_real.php gives:
($map created by autoload_namespaces.php)
Symfony\Component\EventDispatcher\ -
Array ( [0] => /var/www/php/vendor/symfony/event-dispatcher )
Solarium\ -
Array ( [0] => /var/www/php/vendor/solarium/solarium/library )
($classMap created by autoload_classmap.php)
classMap -
Array ( )
The empty array for classmap seems odd. Is that correct?
Thanks
P
Upvotes: 1
Views: 1648
Reputation: 83
The problem is that I have used the Examples folder from version 2.4.0 (of Solarium) but the classes are from version 3.
The class names have changed between the two versions
I’d originally copied the solarium entry for composer.json from the install instructions and the version was 2.4.0. I then ran the composer install and copied the examples into the website before then deciding to update to version 3 of solarium. However I didn’t update the examples folder on the web site.
Updating the examples folder to version 3 fixed the problem.
P
Upvotes: 1