Skip to content
PHP and Laravel4 min read

500 Server Error after uploading a Laravel project to hosting

500 | Server Error

Short answer

A 500 after uploading Laravel is a generic message; the real cause is written in storage/logs/laravel.log or the cPanel error log. In order of likelihood: the vendor folder is missing, PHP is older than the project needs, .env is missing or has no APP_KEY, storage is not writable, the database details are wrong, or a config cache from your computer was uploaded. Read the first line of the log and follow the matching section.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. Step one: read the log
  2. Causes and fixes
  3. The document root comes before all of this
  4. How to confirm it is fixed
  5. How to avoid it
  6. On ArabyHost

You get one of two pages: Laravel’s plain grey 500 | Server Error, or the browser’s This page isn't working with HTTP ERROR 500. The first means Laravel started and then failed; the second usually means it never started. Either way, do not guess: the cause is one line in a log, and this page takes you from that line to the fix.

Step one: read the log

  1. Open File Manager, go to storage/logs/laravel.log in your project and scroll to the end. Look for the line starting with production.ERROR:.
  2. If the file is empty or missing, open Metrics → Errors in cPanel and look for an error_log file inside public or public_html.
  3. Or ask the assistant to read the log for you (see the end of this page).

Then match the line:

What the log says Section
vendor/autoload.php: Failed to open stream 1
Composer detected issues in your platform or syntax error, unexpected 2
No application encryption key has been specified 3
laravel.log could not be opened or Permission denied 4
SQLSTATE[HY000] [1045], [2002] or Table '...sessions' doesn't exist 5
A path from your computer such as C:\xampp or /Users/ 6
Vite manifest not found 7

Causes and fixes

1. The vendor folder is missing

vendor holds Laravel’s libraries and is normally not pushed to GitHub. Over SSH, run inside the project:

composer install --no-dev --optimize-autoloader

Without SSH, run the same command on your computer and upload vendor with the project. See Laravel on cPanel without SSH.

2. PHP is older than the project needs

A message like Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.x is explicit: Laravel 11 and later need PHP 8.2 or newer. Open MultiPHP Manager in cPanel, select the domain, pick the version and click Apply. In Select PHP Version, enable the extensions the project needs, such as pdo_mysql, mbstring, intl and fileinfo. could not find driver means pdo_mysql is off.

3. .env is missing or has no APP_KEY

.env is not deployed by Git and is hidden in File Manager because it starts with a dot. Enable Show Hidden Files and check it sits in the project root, not in public. For the key message, follow No application encryption key. If the file exists but its values are not picked up, see .env not loaded.

4. Laravel cannot write to storage

The most common cause when laravel.log itself cannot be written. The full fix, with and without commands, is in Laravel 500 from storage permissions.

5. Database details

On cPanel the database and user names carry your account prefix, like myuser_shop, and DB_HOST=localhost is usual. Fix the values in .env as in create a MySQL database, and see error 1045 and error 2002. Laravel 11 stores sessions and cache in the database by default, so if the log mentions a sessions or cache table, run php artisan migrate --force or import the tables in phpMyAdmin.

6. A config cache uploaded from your computer

bootstrap/cache/config.php stores your computer’s paths and settings. Delete config.php, routes-v7.php, services.php and packages.php from bootstrap/cache, or run php artisan optimize:clear over SSH.

7. Vite assets not built

If the log mentions manifest.json, follow Vite manifest not found.

The document root comes before all of this

The domain’s Document Root must point to the project’s public folder, not its root. Open Domains in cPanel and set Document Root to something like myapp/public. If you get a file list or a 403 instead of a 500, this is the cause; see Index of listing.

How to confirm it is fixed

Reload. If the error changes into a different one, you have moved a step forward: read the log again. Once the site works, make sure .env has APP_ENV=production and APP_DEBUG=false, and test the login page and a form that saves to the database.

How to avoid it

Keep a fixed deploy checklist: composer install --no-dev, a production .env, php artisan migrate --force, npm run build, then php artisan optimize. The Laravel deployment guide covers each step.

On ArabyHost

Ask the Araby AI assistant in the panel to read the error log: it explains the line that stopped the app and the fix it suggests. You choose PHP 8.1 to 8.3 yourself, and LiteSpeed reads the .htaccess that ships with Laravel in public. AI/Developer plans include SSH jailed in CageFS with Composer and Git for artisan commands; on other plans you work from File Manager. More in Laravel hosting.

FAQ

Where do I find the cause if the page shows nothing?

In storage/logs/laravel.log inside the project, under Metrics then Errors in cPanel, and in the error_log file inside the public folder. If laravel.log is empty or missing, the problem happens before Laravel starts: vendor, PHP version or permissions.

Should I set APP_DEBUG=true to see the error?

Only for a few minutes, then set it back to false: the debug page shows visitors your passwords and .env keys. Reading the log is better and changes nothing.

Can I deploy Laravel without SSH and Composer?

Yes. Run composer install --no-dev on your computer with the same PHP version as the hosting, then upload the project including vendor as a ZIP. The steps are in the guide to deploying Laravel on cPanel without SSH.

The home page works but other links give 404. Is that the same error?

No. That is a URL rewriting problem with the .htaccess file in public, covered on its own page: every Laravel route returns 404 except the home page.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.