# cPanel Installation & Deployment Guide (`erbhau.com`)

## 1. Server Requirements
- PHP **8.2** or **8.3** with extensions: `bcmath`, `ctype`, `fileinfo`, `json`, `mbstring`, `openssl`, `pdo_mysql`, `tokenizer`, `xml`, `gd` or `imagick`.
- MySQL **8.0+** or MariaDB **10.5+**.
- Apache with `mod_rewrite` enabled and active SSL (`https://erbhau.com`).

## 2. Recommended Secure Folder Layout
Keep core application files outside `public_html` so `.env`, `storage/`, and `vendor/` are never directly reachable via HTTP:
```text
/home/<cpanel_user>/
├── erbhau_core/          <-- Upload app/, bootstrap/, config/, database/, resources/, routes/, storage/, vendor/, artisan, composer.json, .env
└── public_html/          <-- Upload contents of public/ (index.php, .htaccess, assets/, robots.txt)
```

## 3. Deployment Steps
1. **Create MySQL Database**: Use cPanel **MySQL® Database Wizard**, create database and user with **ALL PRIVILEGES**.
2. **Upload `erbhau_core` & `public_html`**: Place `erbhau_core` one level above `public_html`, and place `public/*` inside `public_html/`.
3. **Configure `.env`**: Copy `.env.example` to `erbhau_core/.env`, set `APP_ENV=production`, `APP_DEBUG=false`, `APP_URL=https://erbhau.com`, `DB_*`, and `MAIL_*`.
4. **Update `public_html/index.php`**: Point autoloader and bootstrap paths to `../erbhau_core/vendor/autoload.php` and `../erbhau_core/bootstrap/app.php`.
5. **Import Database**: Run `php artisan migrate --seed --force` OR import `database/schema/erbhau_initial.sql` via **phpMyAdmin**.
6. **Provision First Super Admin**: Run `php artisan erbhau:create-admin` via cPanel Terminal (no public default credentials are shipped).
7. **Permissions & Storage Link**: Set `storage/` and `bootstrap/cache/` to `0755`, `.env` to `0600`, and link `erbhau_core/storage/app/public` to `public_html/storage`.
