# Fix 500 error on vanthouse.uks.com.ng

Your site URL is:
`https://vanthouse.uks.com.ng/vanthouse/public/`

Laravel is running but crashing (missing key, DB, or permissions in most cases).

## 1) Open the diagnostic page

Upload the new `public/setup-check.php` (included in the hotfix zip), then open:

`https://vanthouse.uks.com.ng/vanthouse/public/setup-check.php`

It will show exactly what failed.

## 2) Create / fix `.env` in the project root

The `.env` file must sit **next to** `artisan` (one level above `public/`), not inside `public/`.

1. In cPanel File Manager, go to the `vanthouse` folder.
2. If `.env` is missing, copy `.env.vanthouse.example` → `.env` (or copy `.env.example`).
3. Edit `.env` with these values:

```env
APP_NAME="Vantage Finance House"
APP_ENV=production
APP_KEY=base64:GhWrjihuGRNmn9lNqwPWFvonoqX+UidN5/G9ICIShq8=
APP_DEBUG=true
APP_URL=https://vanthouse.uks.com.ng/vanthouse/public
ASSET_URL=https://vanthouse.uks.com.ng/vanthouse/public
SESSION_PATH=/vanthouse/public

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=YOUR_CPANEL_DB_NAME
DB_USERNAME=YOUR_CPANEL_DB_USER
DB_PASSWORD=YOUR_CPANEL_DB_PASSWORD
```

> A ready `APP_KEY` is already filled above. Keep it private.

## 3) Import the database (if not done)

phpMyAdmin → select your DB → Import → `vantage_finance_house.sql`

## 4) Fix folder permissions

In File Manager, set **775** (or 755 if 775 not allowed) on:

- `storage`
- `storage/logs`
- `storage/framework`
- `storage/framework/cache`
- `storage/framework/sessions`
- `storage/framework/views`
- `bootstrap/cache`

Enable “Recurse into subdirectories” if available.

## 5) Reload the site

Open again:

`https://vanthouse.uks.com.ng/vanthouse/public/`

If it still fails, reopen `setup-check.php` and read the **laravel.log** section.

## 6) After it works

1. Set `APP_DEBUG=false`
2. **Delete** `public/setup-check.php`
3. Change demo passwords

## Optional: hide `/public` in the URL

Upload the root `.htaccess` (included) into `/vanthouse/` (same folder as `artisan`), then you can use:

`https://vanthouse.uks.com.ng/vanthouse/`

and update:

```env
APP_URL=https://vanthouse.uks.com.ng/vanthouse
ASSET_URL=https://vanthouse.uks.com.ng/vanthouse
SESSION_PATH=/vanthouse
```
