0
votes

I have uploaded my laravel project into the hosting. My folder structure looks like this

-httpdocs
 -app
 -config
 -resources
 -database
 -contents of public folder(htaccess,index.php etc.)
 -storage
 -vendors

I have moved the contents and subfolders of public folder. Now when i access my website www.something.com i get internal server error. I tried to remove the index.php( this file from public folder which moved to httpdocs) and replace with index.html. I able to see the see the page when i access my website. but when replace with index.php i get the internal server error.

i have changed a bit of index.php file like this

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

Here is my htaccess file

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Is it happening because of the permission of the bootstrap folder ? or any guess behind the issue ? I am stuck up with this for the past 3 hours

1

1 Answers

0
votes

Linux Server

Maybe make sure that the permissions on the folders are correct. For instance, I think 'storage' has to have more relaxed permissions (777, 755 or so). Quite often uploading via FTP can lose the permissions attached to folders.

Go to the root of your laravel installation and run the following command:

chmod -R 777 storage

The storage directory contains your compiled Blade templates, file based sessions, file caches, and other files generated by Laravel. So if you dont have the right read/write permissions it will cause a 500 internal server error

Windows server

According to this the following command will fix the permission issue's on IIS7

cacls laravel /t /g everyone:f