500 Internal Server Error Something on the website crashed!
Other Information
I developed a school website using Laravel and I would like to test it before actually using a paid hosting for full implementation. Unfortunately, I am getting the error stated above everytime I try to access the website.
Here’s what I have done so far:
Created a Database and imported tables without error
Configured database as per my MySQL Connection Details (yes, the app does uses MySQL)
Moved .htaccess in /htdocs (originally placed inside public folder)
Modified .env file to reflect the server’s configurations
<?php
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';
// Bootstrap Laravel and handle the request...
/** @var Application $app */
$app = require_once __DIR__.'/../bootstrap/app.php';
$app->handleRequest(Request::capture());
What am I doing wrong or what did I miss? Thank you in advance.
Are you actually trying to use Redis and Memcached or not because those are not supported
Besides InfinityFree is not a trial. If you want to evaluate iFastNet you need to get iFastNet hosting not InfinityFree because those are two very very different services
This means your PHP code crashed. We don’t know what your code is so we cannot just help you like that, but you could start with enabling debug in Laravel so you get the actual error message instead of a generic error.
Enabling APP_DEBUG should give you a real error message, so it’s strange that it doesn’t work.
I checked your website and I think I found the reason. The bootstrap/cache/ folder contains a cached PHP config file. Since that file is present, Laravel doesn’t check the config files or .env file, and just uses the cached data. And in that cached config, the debug option is disabled.
I suggest you start by deleting all PHP files in the bootstrap/cache folder and then refreshing the page to see if you can get a real error message.
That 500 error page usually indicates a problem with your .htaccess file.
Looking more closely at your .htaccess setup, I think I can see why that is.
My recommendation for setting up Laravel is to put a small .htaccess file in the htdocs directory and leave the official htdocs in-tact.
You appear to have moved the original .htaccess and have attempted to modify it for the different subdirectory. It’s possible to make a Laravel site work that way too, but it’s a lot more complicated and more likely to break with upgrades. Your current rules are not cutting it, at least.
Originally, the .htaccess was located at /public. I moved it outside (htdocs). Let me try to put it back to the og location and then undo the rules I added in.