That will make your application insecure I highly suggest setting up laravel correctly.
You point to public as document root.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello.
For some reasons i need to relocate all stuff from project/public folder to project folder aka root folder. I made some changes in index.php and on shared server everything works. But when I work on a local PC I get an error:
WARN PHP Fatal error: Uncaught Error: Failed opening required 'public/index.php' (include_path='.:/usr/share/php') in vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php:16.
I understand the meaning of this particular error and understand that sail incorrectly sees the folder in which it is stored index.php . How do I reconfigure sail so that it sees the paths correctly from root, not from public?
Thanks.
Please or to participate in this conversation.