PHP Solarium - Composer Autoload giving class not found errors -
i'm trying solarium running on centos 6.5 rpm install of php (5.3.3) , apache httpd.
i have followed instructions on website, creating folder /var/www/php (which in include path in php.ini) , downloading composer. i've entered following composer.json:
{ "require": { "solarium/solarium": "3.*" } }
and run "php composer.phar install".
i trying run examples in solarium examples folder (specifically 1.1 solr ping example). have amended init.php include line:
require('vendor/autoload.php');
i have confirmed vendor/autoload.php being run adding print statement it.
however, when run example 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 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 seems solarium files not being loaded intended.
not sure if solarium or composer problem (i suspect latter). can 1 suggest way debug this?
issuing command "php composer.phar dump-autoload" generates message:
generating autoload files
is correct (i assume not based on description of command)?
running:
php composer.phar diagnose
gives: checking composer.json: fail name : missing , required description : missing , required no license specified, recommended so. closed-source software may use "proprietary" license. checking platform settings: fail
your php (5.3.3) quite old, upgrading php 5.3.4 or higher recommended. composer works 5.3.2+ people, there might edge case issues. checking git settings: ok checking http connectivity: ok checking disk free space: ok checking composer version: fail not running latest version
none of fatal. correct?
many thanks
paul
update:
some more info. adding print statements vendor/composer/autoload_real.php gives:
($map created 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 autoload_classmap.php)
classmap - array ( )
the empty array classmap seems odd. correct?
thanks
p
the problem have used examples folder version 2.4.0 (of solarium) classes version 3.
the class names have changed between 2 versions
i’d copied solarium entry composer.json install instructions , version 2.4.0. ran composer install , copied examples website before deciding update version 3 of solarium. didn’t update examples folder on web site.
updating examples folder version 3 fixed problem.
p
Comments
Post a Comment