# cPanel installation and empty-response troubleshooting

1. Set the domain to **PHP 8.2 or newer** in cPanel's PHP version selector (commonly MultiPHP Manager or Select PHP Version). Enable `pdo_mysql` and `mbstring`. The exact controls depend on the hosting provider.
2. Upload and extract the complete source ZIP. Preserve `app`, `public`, `database`, and `bin` as sibling folders. Configure the domain document root to `ali-gelle/public` when the host permits it. Uploading only the HTML, CSS, and JavaScript will not work.
3. If using the primary domain's fixed `public_html`, put the **contents** of `public` in `public_html`, and put `app` immediately beside `public_html`, outside the web root. In this layout, `public_html/api.php` must be able to read `../app/bootstrap.php`. Keep database, bin, tests and other private files outside the web root too. Do not overwrite another application's existing app folder.
4. Create a MySQL database and user in cPanel, assign the user to that database, and grant its database permissions. cPanel often prefixes names with the account name; use the full names shown in cPanel.
5. Copy `app/config.example.php` to `app/config.php`. Set the host supplied by your provider (often localhost), the full database name, full user name, and database password. Do not upload the local demo config: its Unix socket path is specific to the development computer.
6. From the extracted project folder in cPanel Terminal, run the setup with the domain's PHP 8.2+ executable:

```sh
ADMIN_EMAIL='your-email@example.com' ADMIN_PASSWORD='your-unique-long-password' php bin/setup.php
```

Check `php -v` first: cPanel's Terminal PHP version can differ from the domain's version. Your host can provide the correct executable path. Run setup once for a new database. Add `--demo` only if you want fictional sample data. The local demo login is not created by a normal installation.

7. Open the domain over HTTPS and refresh the page to load the updated JavaScript.

## If the page reports an empty or invalid response

Open `https://YOUR-DOMAIN/api.php?action=session` (include the installation subfolder if applicable). A healthy response contains `user` and `csrf`. The updated endpoint also reports an unsupported PHP version, missing extension, or missing app folder as readable JSON.

If the response is still empty or HTTP 500, check cPanel's error log immediately after refreshing. A server configuration error can occur before the application runs. If session works but signing in fails, check database credentials, permissions, and whether setup created the tables and account.

Share the error text, PHP version, and HTTP status when requesting help. Do not share database passwords, session cookies, or configuration secrets.
