Live page truncated to 30 bytes

Symptom

A page returned HTTP 200 with a 30-byte body on hosting while the same page rendered fully locally. Error display is off on hosting, so the browser showed a silent truncation instead of the fatal.

Ruled out

  1. Stale files: a probe reporting md5_file() of every involved class proved all 8 hashes identical to the repo.
  2. OPcache: a probe running opcache_invalidate() on 12 files reported success — the page still truncated.

Root cause

src/.php is a symlink to src/ao/.php locally (one inode), but the FTP deploy resolves symlinks into two real directories. One page loaded the same helper through both spellings, and require_once — which dedupes by path, not by inode across machines — loaded it twice:

Fatal error: Cannot redeclare get_urls()

Unreproducible locally by design: the two paths can never diverge while linked.

Fix

Guard the definition so the second load is a no-op:

if (!function_exists('get_urls')) { function get_urls(...$numbers) { ... } } // function_exists('get_urls')

The hosting error log named file and line outright — it is always the first place to look. A repo-wide scan found 9 files requiring their own twin path; 8 were commented out, only this one executed.

Автор статьи: Андрей Олегович