# PHP CMS deployment (cPanel)

Upload the **contents** of this folder to your web root (`public_html/`), not the `php/` folder itself.

```text
public_html/
├── admin/
├── api/
├── includes/
├── config.php      ← copy from config.example.php
└── (static site from out/ goes here too)
```

## Quick start

1. Import `schema.sql` in phpMyAdmin
2. Copy `config.example.php` → `config.php` and set MySQL credentials
3. Visit `/admin/health.php` — should show PHP OK + database connected
4. Visit `/admin/setup.php?token=setup-once`
5. Login at `/admin/` with `admin@tiksnip.io` / `changeme123`
6. Change the password by re-running setup with `?password=YourNewPassword`

**XAMPP local URL example:** `http://localhost/tiksnip/admin/`

Expected folder layout under `htdocs/tiksnip/`:

```text
admin/
api/
includes/
config.php
schema.sql
```

Do **not** nest an extra `php/` folder (wrong: `htdocs/tiksnip/php/admin/`).

### Existing database upgrade

If you already imported `schema.sql` before footer links were added, also run:

`php/migrations/002_footer_section_links.sql`

## API endpoints

- `GET /api/v1/site.php` — full published site (used by Next.js build)
- `GET /api/v1/pages.php?status=published`
- `GET /api/v1/languages.php`
- `GET /api/v1/navigation.php`
- `GET /api/v1/footer.php`
