3
votes

I have developed a project in laravel 5.4. It's working perfect in local environment. When i uploaded it on server environment. It displays only a blank page and return no error.

In my .env file I enabled error display :

APP_DEBUG=true APP_LOG_LEVEL=debug

I have also given 777 permission for storage directory. Another folders have 755 permission, files have 644 Permission.

In my .htaccess file code is :

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

My Server PHP Version is 5.6.

2
check phpinfo() or check php.ini display error on, it ll show you errorsOmi
Already my phpinfo() is display_errors - On Status @OmiKarthik
did you check whether your server specifications met or not...Veshraj Joshi
is it shared hosting?sumit
yes.. it is shared hosting @sumitKarthik

2 Answers

1
votes

If you are using shared hosting, maybe the document root path is not right. for laravel it should point to the public folder. you can check this guide, it has more data on how to run laravel on shared hosting.

https://github.com/petehouston/laravel-deploy-on-shared-hosting/blob/master/README.md

0
votes

It may not get the index.php file from your your project public folder. You can try the following steps: 1. Renaming the server.php to index.php (no modifications). 2. Copy the .htaccess from public folder to root folder (like rimon.ekjon said below). 3. Changing .htaccess it a bit as follows for statics:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]

Or if above solution is not working then try this one. You just need to cut index.php and .htaccess from public directory and paste it in the root directory,thats all and replace two lines in index.php as:

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

It may solve your problem.