# HIK Sync Phase 1 Layout Fix Date: 2026-07-23 ## Scope Phase 1 corrected only the HIK Sync receiver directory layout. No SQL was executed, no database credentials or grants were changed, no HRIS tables were modified, and `backend/.htaccess` was not changed. ## A. Backup location The complete pre-change `backend/hik-sync` directory was copied to: ```text C:\xampp\htdocs\smdummy\_backups\hik-sync-phase-1-layout-fix-20260723-123715 ``` The backup contained seven files. Every source file was verified against its backup using SHA-256 before the layout was changed. ## B. Files moved The contents of `backend/hik-sync/receiver` were moved directly into `backend/hik-sync`: ```text backend/hik-sync/.htaccess backend/hik-sync/config.php backend/hik-sync/health.php backend/hik-sync/lib.php backend/hik-sync/receive.php backend/hik-sync/replay.php backend/hik-sync/sql/install.sql ``` The empty `backend/hik-sync/receiver` directory was removed. Each relocated file still matches its backed-up copy by SHA-256. The receiver `.htaccess` protection was preserved. The following resources returned HTTP 403 over both local HTTP and Tailscale HTTPS: ```text config.php lib.php replay.php sql/install.sql ``` ## C. PHP syntax results PHP syntax checks passed for every HIK Sync PHP file: ```text config.php - no syntax errors health.php - no syntax errors lib.php - no syntax errors receive.php - no syntax errors replay.php - no syntax errors ``` ## D. Local HTTP result Request: ```text http://localhost/smdummy/backend/hik-sync/health.php ``` Result: ```text HTTP 503 Service Unavailable Content-Type: application/json; charset=utf-8 {"ok":false,"database":false,"service":"horizon-hik-sync"} ``` ## E. Tailscale HTTPS result Request: ```text https://hris-server.tail688b10.ts.net/smdummy/backend/hik-sync/health.php ``` Result: ```text HTTP 503 Service Unavailable Content-Type: application/json; charset=utf-8 {"ok":false,"database":false,"service":"horizon-hik-sync"} ``` The request reached the Tailscale address `100.116.164.23` successfully. ## F. Rewrite-loop status The Apache rewrite-loop HTTP 500 is resolved. The expected URL now reaches `health.php` and returns its application-level JSON response. No change was made to `backend/.htaccess`. ## G. Remaining database error A connection-only PDO test was performed without executing SQL. MariaDB rejected authentication with MySQL driver error: ```text 1045 - authentication rejected ``` This is a separate Phase 2 issue. No database credentials, accounts, grants, schemas, or records were changed.