Anyone else is experiencing an error when creating new API tool when navigating to: [url]/api-tools/ui ?
Currently I am getting:
Fatal error: Uncaught Laminas\ModuleManager\Exception\RuntimeException: Module (ApplicationTest) could not be initialized. in E:\RZECZY_ADAMA\_XAMPP\xampp-7.4\htdocs\laminas_app\vendor\laminas\laminas-modulemanager\src\ModuleManager.php:202
It looks like you added the module ApplicationTest in config/modules.config.php.
You shouldn’t. Can you show use the content of this file => config/modules.config.php
have you tried to overwrite the value of path_spec to psr-4 in the following config:
'api-tools-admin' => [
// path_spec defines whether modules should be created using PSR-0
// or PSR-4 module structure; the default is to use PSR-0.
// Valid values are:
// - Laminas\ApiTools\Admin\Model\ModulePathSpec::PSR_0 ("psr-0")
// - Laminas\ApiTools\Admin\Model\ModulePathSpec::PSR_4 ("psr-4")
// 'path_spec' => 'psr-0',
],
Thanks for the response. In reference to the above pic your tried to create the “ApplicationAPI” module and with in that directory you have all this directory structure: confg, src, view etc. Is that right. In my case it is not created at all in the module folder and the UI just responds with the error message “…already exists”. Neither there is any entry that gets created ( “ApplicationAPI” or whatever I try to create) in modules.config.php. Please advise.
I have found the solution:
I gave 0744 permission to ‘config’ and ‘module’ folders and that resolved the problem of “…already exists”:
$ sudo chmod 0744 config
$ sudo chown www-data:www-data module
$ sudo chmod 0744 module
$ sudo systemctl reload apache2