Laravel return empty response / laravel 301 Moved Permanently

Error messages:

laravel The connection to the server was reset while the page was loading.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data
CONNECTION_RESET
The mysitename.com page isn’t working it didn’t send any data.
err_empty_response no data received
zend_mm_heap corrupted
laravel empty response
internal server error when using passport jwt token with request POST,GET

Problem 1 : laravel 301 Moved Permanently:

solution :

in public/.htaccess file change the redirect trailing status from 301 to 307

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

Problem 2: Laravel return empty response

about the problem :

many times the problem coused by “zend_mm_heap" ,

Solution :

disable zend_mm_heap , Note : Please note that disabling OPCache will decrease performance.

add the php_flag opcache.enable Off command to htaccess as follow:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
php_flag opcache.enable Off
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder…
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=307]
# 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>
Show your support

Clapping shows how much you appreciated Mahdi Shanak’s story.