Solved! Laminas paginator, PHP Fatal error ... Module (Laminas\Paginator) could not be initialized

FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Laminas\ModuleManager\Exception\RuntimeException: Module (Laminas\Paginator) could not be initialized

my server php ver is 8.1
nginx web server.

When I installed laminas-paginator via composer. Then I can not open any page of the project. And I cat the above error note from the nginx error log.

It is weired that when I run the project via php builtin server. php -S 0.0.0.0:9999 -t public public/index.php it works well!!!

Any body can help?

When I chown -R www-data:www-data the project folder, everything goes normal.

Hi @jobsfan,
This is indeed a strange error. I’ve got a local setup working with PHP8.1 configuration and it has no issues like the one you’ve mentioned. There must be some other errors you need to check. Thanks!

Thank you!

When I chown -R www-data:www-data the project folder, everything goes normal.

I don’t know why, but I will not bother when it runs well.

Hi @jobsfan,

You don’t need to do that. If you want to you can do that on the data/ folder. Because that is the place where some data got written by your app and that is the place where mostly the problem occurs. So, just do that and it will be fine. If you’re so eager to give the whole project folder should be accessible for writing to Apache. Then you should read this answer.

I hope it helps.

1 Like