afoysal's avatar

Laravel in Shared Hosting

I am trying to install a Laravel application in Shared Hosting following this tutorial where my server's PHP version is 7.1.17 and my Laravel version is 5.6.15.

When I am trying to browse my application using Chrome I can see only a White page, even no error is there.

I tried to debug the application and found that below code of index.php is not working.

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

What is the solution of this issue?

0 likes
10 replies
Sergiu17's avatar

You could temporarily set APP_DEBUG=true to see exactly what the error is.

Or open storage/logs/laravel.log there could be a lot of reasons why your app doesn't work

afoysal's avatar

Thanks @Sergiu17 for your reply. I did APP_DEBUG=true in both .env file and app/config.php file. Even I try to find out something in storage/logs/laravel.log but I did not get anything there.

skoobi's avatar

Are the core files in the public_html directory or in the base directory? It may be that if its in the base dir, if i remember you need to update the path of the index.php to make sure it pics up the bootstrap files . Im pretty sure it would squawk if it wasnt right

index.php (in public dir)

require __DIR__.'/../bootstrap/autoload.php'; //Path to your files


$app = require_once __DIR__.'/../bootstrap/app.php';
jlrdw's avatar

I could scream here, as this same question about shared hosting gets asked and answered every few days. It really gets old. A search in the search box would answer all the questions on hosting.

But here we go again:

https://laravel-news.com/subfolder-install (from laravel news)

http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

These guides work, I recently

Just to prove to someone who insisted it don't work

I installed ver 5.5 on godaddy and was properly up and running in no time.

People have to follow the guide.

afoysal's avatar

Thanks @Sergiu17 , @jlrdw , @skoobi , @Nash . I am getting below error.

[09-May-2018 15:44:17 UTC] PHP Fatal error:  Uncaught ErrorException: file_put_contents(/home/foysal/Videos/bad-laravel-adminpanel/storage/framework/views/91c1611d010431b3956d338a2c74e16e093af712.php): failed to open stream: No such file or directory in /home/aylatddd/lsapp/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122
jlrdw's avatar

First:

  • Setup laravel correctly
  • create a symbolic link to storage if needed
//or if not sensitive just store under public_html/yoursite/your folder for your images and stuff

But main laravel is above public_html.

If you did not set up correctly, please do so first prior to asking.

Edit: By following those guides I have never had any trouble with sessions, cookies, Auth, or other issues that people seem to report.

1 like
skoobi's avatar

if Your still having issues after following these tutorials/guides (Novate one normally works for me) try ‘php artisan cache:clear’ if you have access to ssh. Or clear cache on your local host first then upload just in case it’s caching the config files there.

1 like
afoysal's avatar

Thanks @skoobi . I cleared cache on your local host first then upload it. But still I am getting the error.

jlrdw's avatar

Have you checked folder permissions.

Please or to participate in this conversation.