Ariks
Ariks

Reputation: 101

ZEND2 project not working after cloned to separate machine

I have cloned my office colleague's zend2 project from our server. He used zfcuser, zfcbase, and zfcadmin. But when I tried to run the project in my local machine its giving

<b>Fatal error</b>:  Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException'
with message 'Module (ZfcBase) could not be initialized.' in C:\xampp\htdocs\coolshop
\vendor\ZF2\library\Zend\ModuleManager\ModuleManager.php:140

Everything is fine to me as the same project 100% working in my colleague's machine. I tried the composer as well. But no luck

Upvotes: 1

Views: 345

Answers (1)

dperjar
dperjar

Reputation: 343

This is a result of loading the ZfcBase module as a git submodule. If you fix this module you'll receive the same error for other modules or dependencies you're using in that manner. I've encountered this problem when someone tries to clone the project on a new machine or you delete the project locally and try to re-clone it.

The simple answer here is to use composer as your dependency manager, you'll have a better day. Head over to ZfcBase on Packagist and copy the require statement into your composer.json file (You'll need to run the composer script after saving your .json file). Most modules should have instructions on using composer to grab them in the README. I should note that if you're using other modules that depend on ZfcBase, you'll likely just need to have a require statement for those, and not their dependencies (like ZfcBase).

Someone had a similar question regarding the ZfcUser module. Using composer solved his issue.

Upvotes: 2

Related Questions