Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DoktorNik's avatar

Permission Denied on new Project

Hi Everyone,

I'm just starting to look in to Laravel, and sadly having some trouble on a new project. I'm getting permission denied errors when trying to view a brand new app via composer create-project laravel/laravel myapp. I'd appreciate some advice on how to resolve this, or at least some more information on what is happening.

I've tried enabling debug mode, but it fails to write logs with more permission denied errors. I've also tried changing ownership and permission of the entire project directory as a temporary troubleshooting method, but that doesn't work either. I don't see any relevant errors logged by the system or Apache.

OS: RHEL 9

Webserver: Apache/HTTPD

Laravel 11

PHP 8.2 w/ composer

Thanks

0 likes
2 replies
s4muel's avatar

web server needs a write permission for storage and bootstrap/cache, but since you tried changing the permissions for a whole project, this is not probably the case.

afaik RHEL might use SELinux, that could prevent some access on top of base permissions, have a look here, old, but should work something like this: https://stackoverflow.com/a/37258323

sudo semanage fcontext -a -t httpd_sys_rw_content_t "/path/to/your/laravel/project(/.*)?"
sudo restorecon -R /path/to/your/laravel/project

or disable completely just for testing purposes to rule-out something else
sudo setenforce 0
1 like

Please or to participate in this conversation.