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

legendgod's avatar

Need assistant in migrate Laravel to new host

I am currently migrate a Laravel site from a virtual hosting to a shared hosting. After I uploaded the php files and import the MySQL to new hosting, I updated \public_html\bootstrap\cache\config.php for the paths and MySQL db config.

However when I try to load the site it returns 2 errors:

InvalidArgumentException in FileViewFinder.php line 137: View [auth.login] not found.

ErrorException in Filesystem.php line 81: file_put_contents(/public_html/storage/framework/sessions/xxxxxxxxxx): failed to open stream: No such file or directory

For the first error, I double checked \public_html\resources\views\auth\login.blade.php is existing. What else should I check?

Thank you in advance.

0 likes
8 replies
Sergiu17's avatar

Hi, storage directory should be writeable, try to run this sudo chmod 777 -R storage/

this should fix something)

Tray2's avatar

Using 755 should be enough. :)

Sinnbeck's avatar

777 could in theory be dangerous on shared hosting. Any user could put a php file into the storage public directory and call it from the websites frontend (Most shared hosting providers have other safeguards in place to make sure this does not happen, but no need to risk it)

legendgod's avatar

Thanks for your advice. I changed /storage to 755 recursive. But the error (1 & 2) still the same.

I checked against the files under "/public_html/storage/framework/sessions/". There are 7 files with filename like a random string. (I guess these are old session key belonging to old server?) But the error message is asking for a file name that is not existing. Should I reset the cache and how should I do it?

legendgod's avatar

After some research I found in many forum saying I need to run some command to dump and config Laravel settings. But I don't have a Linux machine or virtual hosting. Is it possible to manually update the php files to setup my Laravel website?

legendgod's avatar

Dear all, since I cannot get it work on shared hosting, I moved to a virtual private hosting. It means I can run SSH command. This time I follow the tutorial to install Laravel from blank new. Make sure it works. The default page with big font Leravel show up immediately.

Then upload and override the existing files (the database is not imported yet). I tried to run the default page and it return 500 error. Checked in "/storage/logs" and none file is created. I have double checked /storage and the /bootstrap/cache directories have 777. I checked the .env have APP_DEBUG=true. What else could I further investigate?

Sergiu17's avatar

@legendgod make sure you have .env file, make sure to run php artisan key:generate, composer install if you use git to upload you project

legendgod's avatar

Thanks. Finally I fixed most of issue and able to login to my Laravel site. This site is built by an ex-employee and his source code do not have .env and some folders (like routes). I download and install a blank Laravel to get those missed components (hopefully).

And you're right Sergiu17. I need to run php artisan key:generate to re-generate my key. I don't know why it works. Do I need to do it again if I migrate to another server?

Now I am looking into all plugin one bye one... e.g. JasperPHP is throwing java.lang.ClassCastException

Please or to participate in this conversation.