# Arabian CSbans — Installation Guide

**Arabian CSbans** is an improved, fully English release of CS:Bans (the AMXBans-compatible
web ban system for Counter-Strike 1.6 servers), maintained by
[Arabian Servers](https://arabian-servers.com). It includes PHP 8.2 compatibility
(Yii framework 1.1.31 + legacy code fixes), bug fixes, and a new dark theme.

Original CS:Bans by Craft-Soft Team / Urikh Alexander. See the License page inside
the application for full credits and terms (CC BY-NC-SA).

---

## Requirements

- **PHP 7.4 – 8.2** (developed and tested on PHP 8.2)
- PHP extensions: `pdo`, `pdo_mysql`, `gd`, `mbstring`, `ctype`
  (on cPanel: *Select PHP Version → Extensions*)
- **MySQL 5.5+ or MariaDB** database
- Apache or LiteSpeed with **mod_rewrite** enabled (`.htaccess` support)
- An AMX Mod X server running an AMXBans-compatible plugin (for in-game bans)

## Installation

1. **Upload** the entire contents of this package to your web space,
   e.g. `public_html/bans/`.

2. **Check file permissions** after extracting: directories should be `755` and
   files `644`. The official zip carries correct permissions, but if you
   repackage it on Windows or your panel extracts it wrong, you may get a blank
   page / 500 error ("Permission denied" in the error log). To fix, set
   permissions recursively — via SSH:

   ```
   find /path/to/bans -type d -exec chmod 755 {} \;
   find /path/to/bans -type f -exec chmod 644 {} \;
   ```

   or use your file manager's recursive permissions option.

3. **Create a MySQL database** and a database user with full privileges on it
   (cPanel: *MySQL Databases*). Note the database name, username, and password.

4. **Open your site in a browser** — e.g. `https://yoursite.com/bans/`.
   You will be redirected to the installer automatically.
   (If not, open `https://yoursite.com/bans/site/install.html` directly.)

5. The installer checks server requirements, then asks for:
   - **Database** host (usually `localhost` or `127.0.0.1`), name, user, password
   - **Table prefix** (default `amx` — keep it unless you know why you're changing it)
   - **Web admin account** — your login, password, and email for the site's admin panel

   Use the *Test connection* button to verify the database details before installing.

6. Click **Install**. The installer creates all tables and writes
   `include/db.config.inc.php` automatically.

7. **Log in** with the admin account you created, then in the admin center:
   - Add your game server(s) under **Servers** (address `ip:port`, RCON password
     optional but required for kick/ban-from-web features)
   - Add your in-game admins under **Admins**

8. **Configure the game-server side**: point your AMXBans plugin's database
   settings (`amxbans.sql.cfg` or equivalent) at the **same database and table
   prefix** you used in step 5, so bans sync between the game and the website.

## After installation

- The installer disables itself automatically once installed
  (`site/install` returns 404 when a database is configured).
- Make sure `assets/` and `protected/runtime/` remain **writable** by PHP.
- `include/db.config.inc.php` contains your database password — keep file
  permissions at `644` or stricter and never commit it anywhere public.
- If your database runs on a **different machine** than the website, firewall
  the MySQL port (3306) so only the web server's IP can connect.

## Troubleshooting

- **404 on every page except the homepage** → mod_rewrite is off or `.htaccess`
  is being ignored (`AllowOverride All` needed in Apache vhost config).
- **Error about a missing PHP extension** → enable it in your hosting panel's
  PHP settings (the installer lists exactly what's missing).
- **Blank page or 500 error right after upload** → wrong file permissions from
  the zip extraction; see step 2 (directories `755`, files `644`).
- **`Field 'X' doesn't have a default value` (error 1364)** → your MySQL runs
  strict mode and a plugin-added column has no default; add one:
  `ALTER TABLE <table> MODIFY <column> <type> NOT NULL DEFAULT '';`
- **Server shows as offline on the Servers page** → the web host must be able
  to send UDP packets to your game server's port, and the game server must
  answer Steam A2S queries.

---

© 2013-2026 Arabian Servers — based on CS:Bans by Craft-Soft Team.
