zendframework / zend-http

Http component from Zend Framework
BSD 3-Clause "New" or "Revised" License
134 stars 85 forks source link

can't initialized Zend/http #90

Closed enterume closed 8 years ago

enterume commented 8 years ago

in config\modules.config.php:

return [
    'DoctrineModule',
    'DoctrineORMModule',
    'Zend\Http',
    'Zend\Cache',
    'Zend\Paginator',
    'Zend\I18n',
    'Zend\InputFilter',
    'Zend\Filter',
    'Zend\Hydrator',
    'Zend\Session',
    'Zend\Mvc\Plugin\Prg',
    'Zend\Mvc\Plugin\Identity',
    'Zend\Mvc\Plugin\FlashMessenger',
    'Zend\Mvc\Plugin\FilePrg',
    'Zend\Form',
    'Zend\Router',
    'Zend\Validator',
    'Zend\Validator',
    'Application',
];

But it return :

<b>Fatal error</b>:  Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (Zend\Http) could not be initialized.' in /var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php:203
Stack trace:
#0 /var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(175): Zend\ModuleManager\ModuleManager-&gt;loadModuleByName(Object(Zend\ModuleManager\ModuleEvent))
#1 /var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager-&gt;loadModule('Zend\\Http')
#2 /var/www/html/zf3/blog/vendor/zendframework/zend-eventmanager/src/EventManager.php(271): Zend\ModuleManager\ModuleManager-&gt;onLoadModules(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/html/zf3/blog/vendor/zendframework/zend-eventmanager/src/EventManager.php(143): Zend\EventManager\EventManager-&gt;triggerListeners(Object(Zend\ModuleManager\ModuleEvent))
#4 /var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(120):  in <b>/var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php</b> on line <b>203</b>

Any idea?

Ocramius commented 8 years ago

Zend\Http is not a module ;-)

On 6 Oct 2016 11:22 a.m., "enterume" notifications@github.com wrote:

in config\modules.config.php:

return [ 'DoctrineModule', 'DoctrineORMModule', 'Zend\Http', 'Zend\Cache', 'Zend\Paginator', 'Zend\I18n', 'Zend\InputFilter', 'Zend\Filter', 'Zend\Hydrator', 'Zend\Session', 'Zend\Mvc\Plugin\Prg', 'Zend\Mvc\Plugin\Identity', 'Zend\Mvc\Plugin\FlashMessenger', 'Zend\Mvc\Plugin\FilePrg', 'Zend\Form', 'Zend\Router', 'Zend\Validator', 'Zend\Validator', 'Application', ];

But it return :

_br /> Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (Zend\Http) could not be initialized.' in /var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php:203 Stack trace: #0 /var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(175): Zend\ModuleManager\ModuleManager->loadModuleByName(Object(Zend\ModuleManager\ModuleEvent))

1 https://github.com/zendframework/zend-http/pull/1

/var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager->loadModule('Zend\Http') #2 https://github.com/zendframework/zend-http/pull/2 /var/www/html/zf3/blog/vendor/zendframework/zend-eventmanager/src/EventManager.php(271): Zend\ModuleManager\ModuleManager->onLoadModules(Object(Zend\ModuleManager\ModuleEvent))

3 https://github.com/zendframework/zend-http/pull/3

/var/www/html/zf3/blog/vendor/zendframework/zend-eventmanager/src/EventManager.php(143): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))

4 https://github.com/zendframework/zend-http/issues/4

/var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(120): in /var/www/html/zf3/blog/vendor/zendframework/zend-modulemanager/src/ModuleManager.php on line 203_

Any idea?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zendframework/zend-http/issues/90, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJakBqJUaFymaOV1dBuu8B0lfrSjqpGks5qxL3BgaJpZM4KPuSK .

froschdesign commented 8 years ago

@enterume Remove Zend\Http from the module.config.php file and use the class directly:

$request = new \Zend\Http\Request();

See also the quick start in documentation.