Help me in solving HTTP ERROR 500
-
I am getting HTTP Error 500, I am new to programming below is chatgpt generated steps what and how I have done, I am doing this on shared hosting, the message is little long, any help to this non coder is highly appreciated.
PHASE 1 — File Upload & Folder StructureCreated a folder named bagisto inside the home directory.
Your hosting structure looked like:
/home/sites/.../
public_html/
bagisto/Uploaded Bagisto 2.3 source code into:
/home/.../bagisto/
That folder contains:
app
bootstrap
config
public
vendor (after composer install)
storage
PHASE 2 — SSH SETUPCreated a new SSH key on local system (old one removed).
Added SSH public key to hosting panel.
Successfully logged into SSH via:
ssh <your-user>@ssh.gb.stackcp.com
PHASE 3 — Composer InstallNavigated to project folder:
cd ~/bagisto
Installed dependencies:
/usr/php83/usr/bin/php /usr/local/bin/composer install --no-dev --optimize-autoloader
This generated the vendor folder.
PHASE 4 — Environment SetupCopied the environment file:
cp .env.example .env
Completely rewrote .env with the correct values such as:
APP_NAME
APP_URL
APP_ENV
DB_HOST
DB_DATABASE = the auto-suffixed database name from hosting panel
DB_USERNAME = the DB user created in panel
DB_PASSWORD = the DB user password
Queue settings
Mail defaults
(All sensitive data removed)
PHASE 5 — Database PreparationVerified the real database name in hosting panel
(It had an automatically generated suffix).Attached the DB user to the database and granted ALL PRIVILEGES.
PHASE 6 — Laravel CommandsAll run using the PHP 8.3 binary:
Generated application key:
/usr/php83/usr/bin/php artisan key:generate
Created queue table:
/usr/php83/usr/bin/php artisan queue:table
Ran migrations and seeders:
/usr/php83/usr/bin/php artisan migrate --seed
Migrations succeeded
Seeders executed
All tables createdCreated storage symlink:
/usr/php83/usr/bin/php artisan storage:link
Cleared caches:
/usr/php83/usr/bin/php artisan optimize:clear
PHASE 7 — Web Root ConfigurationSet document root for the domain to:
bagisto/public
(Hosting system automatically prepends the full server path.)
️ THE ONLY REAL ERROR FOUND (From your logs)Your Bagisto app tried to connect to database:
bagisto_db
But your actual database name is:
bagisto_db-<random-suffix>
So MySQL blocked access and caused the 500 internal server error.
-
Hello @umarbuilds
It looks like you did everything correctly the only actual issue is the database name mismatch.
Your Bagisto installation is trying to connect to:
bagisto_db
But on your hosting panel, the real database name is something like:
bagisto_db-xxxxx (with an auto-generated suffix)
Because the DB name in .env does not match the real one, MySQL rejects the connection, which triggers the HTTP 500 error.
Kindly let us know if you have further queries.
Regards