One of our extensions give the following error message on the front page:

Warning: require_once(/var/www/html/magento2/app/code/xxxVendor/xxxModule/registration.php): failed to open stream: Permission denied in /var/www/html/magento2/app/etc/NonComposerComponentRegistration.php on line 29

Fatal error: require_once(): Failed opening required '/var/www/html/magento2/app/code/xxxVendor/xxxModule/registration.php' (include_path='/var/www/html/magento2/vendor/magento/zendframework1/library:.:/usr/share/pear:/usr/share/php') in /var/www/html/magento2/app/etc/NonComposerComponentRegistration.php on line 29

This also happens if the module is disabled. If I rename the registration.php and have the module disabled, the error is gone. One would think this has something to do with file permissions, but I've tried the recommended permissions several times, done composer update, setup update, di compile, deploy static content, cleared cache etc.

Any hints?

2 Answers 2


I would recommend this :

1 - Make sure the file path is correct

2 - Make sure all your project file and folders have the goods rights (release path being your magento installation root).

find, release_path, "-type d ! -perm 755 -exec chmod 755 {} +"
find, release_path, "-type f ! -perm 644 -exec chmod 644 {} +"

3 - You seems to have partially a local path in there ? Make sure it's not what is getting you the error : var/www/html/magento2/vendor/magento/zendframework1/library:.:/usr/share/pear:/usr/share/php

  • Thanks for your reply. I have tried to set the permissions as suggested (again), with the same result. Is it possible that a bug in the code could cause this, even though the error claims permission error?
    – Dandy
    Oct 19, 2021 at 9:52

I ended up downloading the complete module from my site, deleting the files on the site, then uploading the same files again, and it worked.

I do not understand how that would help, as I re-did all file permissions and file ownerships, and triple checked it with both FTP and SSH. But it did..

  • Well sometimes with computing the better things to do is destroy it and start again :D Good stamina. It works that's what matters. I do not have further explanation sorry. May be someone will have a better idea.
    – Claims
    Oct 19, 2021 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.