Dev-Only PHP Config

How Xdebug, display_errors and other development-only PHP settings stay off remote servers automatically, through git-ignored ini files.

Waddle keeps settings that are pointless or dangerous on a remote (xDebug, display_errors, OPcache file-revalidation, and similar) off every remote by specifying them in specific ini files that are intentionally git-ignored.

How PHP loads the config

PHP is compiled with a scan directory (config-file-scan-dir) pointing at php/conf/conf.d. At startup PHP loads every *.ini file in that directory, in alphabetical order, each one layering on top of the previous. Waddle uses a numeric prefix on the file names to make that order explicit:

File git tracked? What it does
00-opcache.ini yes OPcache sizing, identical everywhere
10-waddle.ini yes Shared settings, including hardened, remote-safe defaults (display_errors = Off, expose_php = Off, OPcache timestamp validation off, …)
80-dev.ini no, git-ignored Development overrides (display_errors = On, OPcache revalidation on, verbose errors, aggressive session GC)
90-xdebug.ini no, git-ignored xDebug debugger configuration

Why this gives the right behaviour in each environment

  • Locally, all four files are present. Because 80-dev.ini and 90-xdebug.ini sort after 10-waddle.ini, their values win, so you get developer-friendly error reporting, live code reloading and a working debugger.
  • On a remote, 80-dev.ini and 90-xdebug.ini were never pushed (they are git-ignored), so only 00-opcache.ini and 10-waddle.ini load. The hardened, remote-safe baseline in 10-waddle.ini is what runs: errors are hidden, the PHP version is not advertised, OPcache trusts its cache for speed, and no debugger is present.

Sharing a project with a colleague

The same git-ignored files raise an obvious question when handing a project off. If your colleague builds it with Waddle, there’s no problem: the missing files are just absent templates, and Waddle renders them again on their machine. If they don’t use Waddle, see Running a Project Without Waddle for what to pack up and send along instead.