Zend framework 2 Skeleton App FATAL error

2019-08-25 05:10发布

问题:

I've installed skeleton app via composer and when pointing the browser to the public folder with virtual host I get the error:

Fatal error: Uncaught exception 'Zend\Loader\Exception\InvalidArgumentException' with message 'Autoloader class Zend\Loader\StandardAutoloader must implement Zend\Loader\SplAutoloader' in /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/Loader/AutoloaderFactory.php on line 91 Zend\Loader\Exception\InvalidArgumentException: Autoloader class Zend\Loader\StandardAutoloader must implement Zend\Loader\SplAutoloader in /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/Loader/AutoloaderFactory.php on line 91 Call Stack: 0.0003 635952 1. {main}() /var/www/vhosts/ddns.net/subdomains/gameotic/public/index.php:0 0.0051 948360 2. Zend\Mvc\Application::init() /var/www/vhosts/ddns.net/subdomains/gameotic/public/index.php:17 0.0304 3051872 3. Zend\ModuleManager\ModuleManager->loadModules() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:252 0.0304 3051952 4. Zend\EventManager\EventManager->trigger() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:115 0.0305 3052128 5. Zend\EventManager\EventManager->triggerListeners() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:207 0.0311 3078984 6. call_user_func() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:468 0.0311 3079016 7. Zend\ModuleManager\ModuleManager->onLoadModules() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:468 0.0311 3079368 8. Zend\ModuleManager\ModuleManager->loadModule() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:96 0.0319 3091176 9. Zend\EventManager\EventManager->trigger() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:174 0.0319 3091216 10. Zend\EventManager\EventManager->triggerListeners() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:207 0.0320 3094016 11. call_user_func() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:468 0.0320 3094048 12. Zend\ModuleManager\Listener\AutoloaderListener->__invoke() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:468 0.0320 3095168 13. Zend\Loader\AutoloaderFactory::factory() /var/www/vhosts/ddns.net/subdomains/gameotic/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/AutoloaderListener.php:34

What can I do? I use Php 5.6 in Plesk panel (Centos 6.6)

回答1:

Your PHP version and Zend Framework version are incomatible. I've learned that PHP 5.3.3 only supports Zend Framework up to version 2.2, this is not meantioned (clearly) in the Zend Framework documentation.