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

javierroman's avatar

Shows cached blade instead of 500 error

Hi all,

I have a laravel application in a shared hosting and in production sometimes when there is an error in the code it shows the cached blade instead of 500 error.

Most of the times it shows 500 error but occasionally it shows the cached blade. It is kind of confusing because I dont know at the begining that there is an error.

In the .env file APP_DEBUG is set to false, but it also happens if it is set to true.

This never happens in local, only in production in the shared hosting.

Does anyone know why this happens and how to always show 500 error?

0 likes
7 replies
vincent15000's avatar

Not sure, but perhaps something to do with .htaccess ?

1 like
javierroman's avatar

@vincent15000

Here is the .htaccess file:

<FilesMatch ".(php4|php5|php3|php2|php|phtml)$"> SetHandler application/x-lsphp73 </FilesMatch> <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule>

RewriteEngine On

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

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

# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
vincent15000's avatar

@javierroman Here is mine, I let you compare. I don't say that this is the solution, I just share mine.

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

    RewriteEngine On

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

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

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
1 like
javierroman's avatar

@vincent15000

Thanks. I see both are the same, it must be something else, maybe the shared hosting has a client-side cache . I will speak to them.

1 like
Akash_kushwaha's avatar

In some hosting servers you have to manually clear caches. like cloudflare have custom purge option to clear cache. everytime to make any new change.

So check if you have something like that in your server.

2 likes
javierroman's avatar

@Akash_kit

Thanks. The only time I have problems with cache is when there is a 500 error. For any other new changes the blade always updates. I will check with the shared hosting company.

2 likes

Please or to participate in this conversation.