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

xereah's avatar

laravel deploy on shared hosting issue

Hi,After copying files from the local directory to the server, the following problem occurs when logging in to the application: "include (/home/users/kk1/public_html/xxxxxxxx/vendor/composer /../../ app / models / User .php): failed to open stream: No such file or directory " I copied the index.php file to the root directory, changed the paths, but it still doesn't work. I can't use composer install or dump-autoload because I can't access via ssh.

0 likes
2 replies
Tray2's avatar

That is bad practice, your .env file is most likely open for anyone to view. That is a huge security issue.

Change the document root to point to /public .

If you can't and are using apache you can use an htaccess file to reroute all requests to /public

Anyways make sure that you upload the vendor directory as well.

xereah's avatar

Thanks for the reply, I'll keep that in mind. I re-uploaded the vendor folder but it didn't help.

Please or to participate in this conversation.