Laravel application does not work after upload to server

The laravel application worked fine on the local server. But after I uploaded it to my server, it does not work. The directory structure of my application is shown in the following image: enter image description here

And I get the following problem. It is automatically redirected to the feedback address, showing nothing enter image description here

Here is my php version on the server

enter image description here

+5
source share
4 answers

Make sure you have the correct web server setup. You must point the web server to the public directory and restart it.

Also, make sure you set the correct permissions for the storage directory:

 chmod -R 775 storage 

And try to clear the entire cache:

 php artisan cache:clear php artisan route:clear php artisan config:clear php artisan view:clear php artisan clear-compiled 
0
source

I also had problems with this. You need to put the โ€œpublicโ€ folder in your www directory (or the corresponding public_html folder if you are using a virtual machine). Then you must put the WHOLE application in your var folder in the directory of your choice, let me call it "MySuperCoolFolder". Finally, you need to modify the index.php file. In particular, these two lines.

 require __DIR__.'/../bootstrap/autoload.php'; 

to

 require __DIR__.'/../MySuperCoolFolder/bootstrap/autoload.php'; 

and

 $app = require_once __DIR__.'/../bootstrap/app.php'; 

to

 $app = require_once __DIR__.'/../MySuperCoolFolder/bootstrap/app.php'; 

And that should do it. If that doesn't work. Go to the documentation and use the .htaccess file that they provide. It did the trick for me.

Best of luck!

Link: https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e#.nvinp0r3e

0
source

Try visiting http://127.0.0.1/Workshop/public_html

There is no index.php or .htaccess in the Workshop folder. Usually they are inside public, but it looks like you have public_html instead

-1
source

If you host the Laravel application inside public_html or inside a subfolder, you must set some rules for .htaccess. Please refer to this answer:

fooobar.com/questions/51707 / ...

If you want to install the web application in the root directory of the server, put the entire contents of the application in the root directory and rename the public_html folder to public_html www or web , regardless of the shared folder of your domain.

-1
source

All Articles