What Laravel needs before the first Composer command
Laravel 11 and 12 need PHP 8.2 or newer and Composer 2. On a cPanel account both are reachable from the panel: PHP from MultiPHP Manager, Composer from Terminal. Check the five items below before you type anything, because a missing one is what most failed installs turn out to be.
| Requirement | Where to check in cPanel | What to do if it is missing |
|---|---|---|
| PHP 8.2, 8.3 or 8.4 | Software, then MultiPHP Manager | Set the domain to an 8.2+ handler. Laravel 12 will not boot on 8.1. |
| Composer 2 | Advanced, then Terminal: composer --version | Install the composer.phar in your home directory and call it with php composer.phar. |
| MySQL or MariaDB database | Databases, then MySQL Databases | Create the database and a user, then add the user to it with All Privileges. |
| A domain or subdomain you can aim | Domains, then Create A New Domain | Use a subdomain. A shared account cannot move the main domain's document root. |
| Terminal access | Advanced, then Terminal | If the icon is absent, your plan has no shell. Build locally and upload vendor/ and public/. |
Two habits save an afternoon. Run every command as the cPanel user, never as root, and keep the project outside public_html so only the public folder is reachable over HTTP. A cPanel hosting account with Terminal access covers all five rows.
Create the project with Composer in Terminal
The project is created with one Composer command inside your home directory, not inside public_html. Open Terminal from the Advanced section of cPanel and work through these steps in order.
- Run
cd ~so you are in your home directory, then confirm the PHP binary withphp -v. It should report 8.2 or higher. - Run
composer create-project laravel/laravel myapp. Composer downloads the skeleton and its dependencies; expect two to four minutes on a shared account. - Run
cd myappand thenphp artisan --version. You know the create step worked when it prints a Laravel Framework version such as 12.x. - Run
php artisan about. It lists the PHP version, cache driver, and environment Laravel is actually using, which is the quickest way to catch a wrong PHP handler.
If Composer stops with a message that ext-fileinfo is missing from your system, the PHP build selected for that domain is short of an extension. Switch the domain to another 8.2+ handler in MultiPHP Manager and rerun the create command. If Composer runs out of memory, prefix the command with php -d memory_limit=512M /usr/local/ instead of raising the account limit for every script.
Aim a domain at Laravel's public folder
Laravel must be served from its public directory. Everything above that folder holds .env, logs, and source code, and none of it should be reachable by a browser. How you arrange that depends on which domain you use.
| Domain type | Where the Laravel folder sits | Document root to set |
|---|---|---|
| Subdomain (recommended) | /home/your- | /home/your- |
| Addon domain | /home/your- | /home/your- |
| Main domain on shared hosting | /home/your- | Cannot be changed away from public_html |
For a subdomain, open Domains, then Create A New Domain, enter app.example.com, untick the share-document-public into public_html, then open public_html/ in File Manager and point its two require lines at the folder above, so they read ../myapp/ and ../myapp/.
The check is simple: load the domain. You should see the Laravel welcome page, not a directory listing and not a 403. A listing means the document root is still the project folder; a 403 usually means an index file is missing from the folder you aimed at.
Connect MySQL and finish the .env file
The database is created in cPanel and described in .env; Laravel does not create it for you. In MySQL Databases, create a database, create a user with a strong password, and add the user to that database with All Privileges. Then edit .env in File Manager and set four values.
DB_DATABASE,DB_USERNAME,DB_PASSWORDfrom the screen you just used. cPanel prefixes both names with your account name, so copy them exactly.APP_URLset to the full https address you will serve, for example https://app.example. com. APP_ENV=productionandAPP_DEBUG=falsebefore the site takes real traffic.
Back in Terminal, run php artisan key:generate to write APP_KEY, then php artisan migrate --force to create the tables. You know the database link works when migrate reports each migration as DONE and php artisan migrate:status lists them as Ran. When you change .env later, run php artisan config:clear, because cached configuration keeps the old values.
Permissions that survive a cPanel PHP handler
Laravel writes to two folders at runtime: storage and bootstrap/cache. Set folders to 755 and files to 644, and use 775 on those two folders only if the panel runs PHP through a handler that needs group write. Never use 777, and never leave index.php group-writable.
The failure this prevents has a specific log line: SoftException in Application.cpp: File .../public/chmod 644 public/index.php and chmod -R 755 public, then reload. If uploads or cache writes still fail, widen storage to 775 and test the feature that writes, not just the home page.
Blank page, 500 error, or Vite manifest error
Most first-deploy failures on cPanel fall into five shapes. Match the symptom, make one change, and reload the page before trying the next row.
| Symptom | Usual cause | Fix |
|---|---|---|
| 500 with SoftException in the log | index.php or a folder is group-writable | chmod 644 on files, 755 on folders, then reload |
| Blank white page, nothing in the log | vendor/ missing or APP_DEBUG hiding the error | Read storage/ |
| Vite manifest not found at public/build/ | Front-end assets were never built | Run npm run build on your machine and upload the public/build folder |
| 403 on every route | Document root is the project folder, not public | Repoint the document root or fix the index.php paths |
| No application encryption key has been specified | APP_KEY is empty | Run php artisan key:generate in the project folder |
One more thing to check before you blame the code: the PHP version that Terminal uses and the one Apache uses can differ. php -v in Terminal proves the command-line handler; MultiPHP Manager sets the web handler. If artisan runs cleanly while the browser throws errors, that mismatch is the first suspect.
What shared cPanel will not do for a Laravel app
Shared hosting runs your app on request, then stops it. That suits CRUD tools, dashboards, and brochure sites. It does not suit anything that must stay resident: queue workers under Supervisor, Laravel Horizon, websocket servers, or long scheduled jobs all need a process that outlives the request.
The workaround on shared is cron. Schedule php /home/your- once a minute, which drains the queue without overlapping runs. When queue depth, concurrent users, or an always-on worker become the normal load, move the same codebase to a VPS server with root access; WebJi quotes VPS and dedicated configurations by email at support@webji.
cPanel hosting from WebJi for Laravel projects
Our L-Developer plan is the one built for this job: more CPU and concurrent entry processes than the entry tiers, Terminal with Composer, and PHP 8.2+ selectable per domain. It is ₹700 per month before 18% GST, and every invoice carries our GSTIN. Account setup and migration are handled by email, not by a call centre.
Email support@webji.
Frequently Asked Questions
Can I install Laravel on cPanel shared hosting?
Yes. Create the project with Composer in cPanel Terminal, aim a subdomain's document root at the project's public folder, fill in the database values in .env, and run php artisan migrate. The limits are process-based: no resident queue workers, no websocket server, and no root access.
How do I point the document root to Laravel's public folder in cPanel?
Open Domains, then Create A New Domain, and set the document root to /home/your-
Do I need SSH, or is cPanel Terminal enough?
Terminal is enough for Composer, artisan, and chmod, because it runs as your cPanel user. SSH is only needed for extras such as Git deploy hooks or rsync, and not every shared plan enables it. If the Terminal icon is missing from Advanced, your plan has no shell access.
Why does my Laravel site show a 500 error on cPanel?
Read the newest line under Metrics, then Errors. The most common cPanel-specific cause is a group-writable index.php under a suPHP-style handler, which is fixed with chmod 644. Storage permissions, a missing vendor folder, and an empty APP_KEY cover most of the rest.
How do I fix Vite manifest not found on cPanel?
The message means public/build/
Does Laravel 12 run on PHP 8.1?
No. Laravel 11 and 12 require PHP 8.2 or newer, and Composer will refuse to install them on 8.1. Set the domain to an 8.2, 8.3, or 8.4 handler in MultiPHP Manager before you create the project, and check the same version with php -v in Terminal.

