Nitish
Nitish

Reputation: 2763

Laravel app hosted within directory shows ERROR 500 - INTERNAL SERVER ERROR

I have a app developed in Laravel 5.1. It is hosted within directory structure as public_html/gnrcnew/gnrcadmin where gnrcadmin is Laravel app. But when I tried to access it shows ERROR 500 - INTERNAL SERVER ERROR. I tried to change the .htaccess within public directory as :

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

    RewriteEngine On
    #RewriteBase /gnrcnew/gnrcadmin/public/
    RewriteBase /~gnrcnew/gnrcadmin/public/

    # 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]
</IfModule>

But same result appears. My url is Laravel App. How can I remove this error ?

storage directory 777 permission : Storage permission from FTP

Upvotes: 1

Views: 1482

Answers (1)

Aditya Giri
Aditya Giri

Reputation: 1836

The thing that you are trying to do is to access the /storage folder just without read write permissions which is required by laravel.

Using File Manager

One of the easy and basic ways to change the permissions is through File manager in cPanel. To change the permissions for a file or folder in cpanel, please do the following:

  1. Click File Manager
  2. Click the name of the file for which you would like to change the permissions.
  3. Select the Change Permissions link at the top right of the page.
  4. Select the permissions you would like to set for the file.
  5. Click Change Permissions

Using FTP

Connect to FTP. Go to the file and right click. Choose Permissions or Attributes or Properties (depends on your program).

Using SSH or a script

This can be done with chmod command.

From HostGator website which is most probably your hosting provider.

EDIT: The directory should have the recursive mode enabled. You are not just giving permissions to one directory, but you are giving it to each and every subdirectory that you find inside that folder. If you still see an error, please post last few errors from your logs.(If it's stored which might not be there).

Upvotes: 2

Related Questions