A 500 Internal Server Error after uploading a Laravel script usually means the server could not run your code at all. The page gives you nothing useful, which is the annoying part. The cause is almost always one of five things — the .env file, folder permissions, a missing app key, the PHP version, or the document root — and you can check all of them in about twenty minutes.

Work through the sections below in order.

What does a 500 error actually mean on a Laravel site?

A 500 error is the server saying something went wrong, without saying what. Laravel hides the real error from visitors by default, which is the right behaviour on a live site — you do not want database passwords in an error page — but it makes debugging feel like guesswork. Your first job is to find the real error message, and the fastest way is the log file at storage/logs/laravel.log. Open it, scroll to the bottom, and read the newest entry. It usually names the problem in plain language: a missing file, a bad database credential, a folder PHP cannot write to.

If the log file is empty or does not exist, that is itself a clue — it often means the storage folder is not writable, so Laravel cannot even write its own error. For a few minutes of debugging, set APP_DEBUG=true in your .env file, refresh the page, and Laravel will show the real error on screen. Switch it back to false the moment you have found the problem. We have seen live sites left in debug mode for months, quietly showing database credentials to anyone who triggers an error.

Is your .env file actually there, and is it correct?

This is the most common cause we see, and the easiest to miss. Laravel ships with a file called .env.example. It is a template. The real file is called .env, and it does not exist until you create it. If you uploaded the files and never copied the example to .env, the site cannot start.

On cPanel, open File Manager, make sure "Show Hidden Files" is enabled — files starting with a dot are hidden by default — and check whether .env exists in your project root. If it does not, copy .env.example to .env and fill in the values. Then generate the app key by running php artisan key:generate over SSH, or ask your host to run it. Without a valid APP_KEY, Laravel throws a 500 on every page, and the log will say so.

On shared hosting, the database name and username almost always carry a prefix — something like username_databasename — and the password is the one you set when you created the database user, not your cPanel password.

Is your document root pointing at the public folder?

Laravel only exposes one folder to the web: public. Everything else — the .env file, the source code, the config — sits one level above it, out of reach. If your domain points at the project root instead of the public folder, visitors hit a 500 or a directory listing, and your .env file is one guess away from being downloadable.

On cPanel, check the domain's document root in Domains and make sure it ends in /public. The same rule applies on a VPS: the server block or virtual host must point at /path/to/project/public.

Are your storage and cache folders writable?

Laravel writes constantly: session files, cached views, logs, uploaded files. If it cannot write, it dies. The folders that must be writable by the web server are storage and bootstrap/cache. The usual fix is to set both to 775, or 755 if your server runs PHP as your own user, and to make sure the folders are owned by the right user rather than by root from an earlier upload.

Do not reach for 777. It works, and it is also an open door: any other account on a shared server could write into your folders. If 775 does not work, the problem is usually ownership, not the permission number, and 777 is papering over it. Our companion guide on fixing permission denied errors on Laravel storage and cache folders covers ownership and the exact commands in detail.

One more quiet culprit: a stale cache. If you uploaded new code over an old install, run php artisan config:clear, php artisan route:clear and php artisan view:clear, or delete the files inside bootstrap/cache except .gitignore.

Does your PHP version match what the script needs?

Laravel versions are strict about PHP. Laravel 11 and Laravel 12 both need PHP 8.2 or newer. Check the PHP version in cPanel under MultiPHP Manager or Select PHP Version, and compare it with the version listed in the product's installation guide.

The extensions Laravel almost always needs are:

  • mbstring, openssl and pdo_mysql — core framework requirements
  • tokenizer, xml, ctype, json and bcmath
  • fileinfo — needed for file uploads

A missing extension gives a 500 at the first page that needs it, which is usually the first page. Our PHP 8.2 and 8.3 hosting checklist for Laravel scripts lists the full set and how to enable each one in cPanel.

A quick checklist to run through in order

Tick each item off from the top.

StepWhat to checkFixed when
1Read storage/logs/laravel.logYou can name the actual error
2.env exists and is not the example fileAPP_KEY is set and key:generate has run
3Database credentials in .envDB_HOST, name, user and password all match cPanel
4Document rootDomain points at the project's public folder
5storage and bootstrap/cache writable775 permissions, correct owner, no 777
6PHP version and extensionsVersion matches the guide, all extensions enabled
7Clear cachesconfig, route and view caches cleared
8APP_DEBUG back to falseLive site hides real errors again

Still stuck after all eight steps?

Then the problem is specific to your server, and guessing further wastes your evening. Write down three things: the newest lines from storage/logs/laravel.log, your PHP version, and whether the error appears on every page or only some. That is everything a support person needs to help you in one reply instead of five.

Every product on codelist ships with full unencrypted source code and an installation guide, plus lifetime free updates, so the code itself is never a black box while you debug it. If you bought a product from us and the install will not run, reach out on WhatsApp at +92 333 4916432 or by email at contact@zqdevelopers.com — send those three details and we will point at the cause. Browse the full catalogue if you are still choosing a product, and check our FAQ page for licence and refund details: a refund applies if a product is materially broken and cannot be fixed, within 14 days.