🔍 Centre CMS — API Diagnostic

Generated: 2026-08-13 09:51:47 +08

1. PHP Environment

PHP Version8.0.23 ✅
Server APIfpm-fcgi
Extension: pdo✅ loaded
Extension: pdo_mysql✅ loaded
Extension: openssl✅ loaded

2. Config File (db/config.php)

db/config.php✅ found
DB_HOSTlocalhost
DB_PORT3307 (Synology default ✅)
DB_NAMEcentre_cms
DB_USERcms_user
DB_PASS✅ set (hidden)
DEBUG_MODE⚠️ true — remember to set false in production
ALLOWED_TABLES✅ 13 tables: members, membership_plans, payments, attendance, facilities, bookings, notifications, exp_users, exp_categories, exp_accounts, exp_expenses, exp_income, exp_transfers

3. Database Connection

Connection✅ Connected successfully
MariaDB Version10.3.32-MariaDB

4. Database Tables

members✅ exists (2 rows)
membership_plans✅ exists (0 rows)
payments✅ exists (0 rows)
attendance✅ exists (4 rows)
facilities✅ exists (2 rows)
bookings✅ exists (1 rows)
notifications✅ exists (11 rows)
exp_users✅ exists (2 rows)
exp_categories✅ exists (17 rows)
exp_accounts✅ exists (5 rows)
exp_expenses✅ exists (31 rows)
exp_income✅ exists (0 rows)
exp_transfers✅ exists (0 rows)

5. URL / Routing Variables

REQUEST_URI/api-test.php
SCRIPT_NAME/api-test.php
HTTP_HOSTinsnc.in
Routing method✅ REQUEST_URI fallback — will work for direct api.php calls
PATH_INFO(empty) — normal on Synology PHP-FPM. Routing uses ?path= query string instead.
NoteThe .htaccess rewrites /tables/x → api.php?path=tables/x — no PATH_INFO needed.

6. .htaccess File

.htaccess✅ present
RewriteEngine On✅ found
AcceptPathInfo On✅ found (used with mod_php)
RewriteRule (?path= method)✅ found — correct query-string routing
Block db/ folder✅ found

7. Live API Call Test (GET /tables/facilities)

Test URLhttps://insnc.in/tables/facilities
HTTP StatusHTTP/1.1 200 OK
Response✅ Valid JSON — data array with 2 records

8. Write Test (INSERT + DELETE on facilities)

INSERT + DELETE✅ Write test passed — cms_user has correct permissions

9. api.php Quick Check

api.php✅ present (15,325 bytes)
'never' return type✅ not found
str_starts_with()✅ not found
Arrow functions (fn=>)✅ not found
Checklist — everything should be ✅ before going live:
 1. PHP 7.4+  2. pdo_mysql loaded  3. DB connected  4. All 7 tables exist  5. Write test passes
 6. PATH_INFO not empty  7. .htaccess has AcceptPathInfo On  8. api.php has no "never" return type

Common fixes:
pdo_mysql ❌ → DSM → Web Station → PHP 8.0 Profile → Extensions → enable pdo_mysql → Apply
DB_PASS ❌ → Edit db/config.php, change CHANGE_THIS_PASSWORD to your real password
Connection ❌ → Check port is 3307, MariaDB is running, cms_user exists (run db/schema.sql)
Tables ❌ → Run db/schema.sql via phpMyAdmin or SSH → MariaDB
PATH_INFO empty → Confirm AcceptPathInfo On is in .htaccess, and mod_rewrite is enabled
Write test ❌ → Run: GRANT SELECT, INSERT, UPDATE, DELETE ON centre_cms.* TO 'cms_user'@'localhost'; FLUSH PRIVILEGES;
"never" return type ❌ → Re-upload the latest api.php from this project

⚠️ Delete or rename api-test.php once everything is working!
Also set define('DEBUG_MODE', false); in db/config.php before going live.

→ Manager Portal  |  → Member Portal  |  ← Home