Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DreadfulCthulhu's avatar

Blank screen after deploy on shared hosting

Hi I already read many about this issue, but I'm still not able to resolve it. After I deployed my project on shared hosting, I'm getting blank screen on any route (existing or not existing) at all. I also turned on any error reporting, but there is nothing on screen, in laravel logs and in error/php logs. When I tried to update web.php router with any and return string, there is also nothing written on display. So code never get to the router. Storage permissions changed to 777

index.php is accessible, but when I tried to find problem, I updated it with echoes:

echo '0001';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
echo '0002';
$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);
echo '0003';
$response->send();
echo '0004';
$kernel->terminate($request, $response);
echo '0005';

Last written is 0002 when I dump code after 0002: When I dump $kernel, i got fulfilled json response of App\Http\Kernel

dump(Illuminate\Http\Request::capture());

I got full json response of Illuminate\Http\Request, but when I dump $kernel->handle():

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

I got nothing, so $kernel, $request are JSON, and $response is nothing and code is broken there without any message.

Any idea how to solve it?

In public/.htaccess I was forced to remove

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

as it is not working on our shared hosting, but I'm sure, that there is no issue, because older project with the same works fine.

0 likes
10 replies
ajithlal's avatar

I can tell you how I host my project on shared hosting.

  1. clone project to the outside of the public_html folder.
  2. move all files inside the public folder cloned project folder to public_html.
  3. edit index.php file and update the autoload.php path and boostrap/app.php path to the project folder. 3 run the necessary command inside the project folder.

I'm always doing the same method when I host my project on shared hosting. Hope this helps.

Snapey's avatar

Usual issue is that your webserver is not permitted to write to the storage folder.

DreadfulCthulhu's avatar

Of course, I forgot to write it in topic, it was already changed to 777.

Snapey's avatar

Oh lovely, nice and secure then?

DreadfulCthulhu's avatar

Unfortunatelly, this made nothing to me. Now it is in root (public deleted), echoes modified and dumping $kernel, $request and $response: https://todo.indeev.eu . As you can see echo '$response:'; is never beign processed (Laravel is 6.7.0)

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
echo '$kernel:<br/>';
dump($kernel);
$request = Illuminate\Http\Request::capture();
echo '$request:<br/>';
dump($request);
$response = $kernel->handle($request);
echo '$response:<br/>';
dump($response);
$response->send();
DreadfulCthulhu's avatar

Yes I know that that is why index should by in /public. But I have no important informations there and it was only tryout of ajithlal's comment above. I'll not have public things out of public folder in production.

franvillada's avatar

Hi @dreadfulcthulhu, im having the same problem when trying to deploy my web app usin cPanel. I tried debugging with your echo's and I get the same thing 0001 and 0002. So it seems something is happing in $kernel->handle();

Where you able to figure this out?

franvillada's avatar

UPDATE:

After spending a whole day trying to figure this out, I find something that work for me.

Basically I write this 3 commands in the terminal:

php artisan cache:clear
php artisan config:clear
php artisan config:cache

After that I hit the magic F5 and it load the app.

Hope its usefull for someone!!

DreadfulCthulhu's avatar

Yes, I found it, I firstly implemented Livewire on my project - that causes issues on production. After Livewire removal and switch back to AJAX calls, everything worked just fine. Clear of any caches didn`t helped me.

Please or to participate in this conversation.