; Copied from the host's live values so behaviour inside the container matches ; what this app is currently developed and tested against. These are not ; "recommended" values — they are the values the code was written against. ; ; memory_limit 10G / max_execution_time 0: several report and export paths build ; large in-memory datasets. If the container is given a memory LIMIT below this, ; PHP never sees its own ceiling and the kernel OOM-kills the process instead of ; PHP raising a catchable fatal. docker-compose.yml therefore sets no mem_limit; ; if you add one, keep it above whatever these paths actually use. memory_limit = 10G max_execution_time = 0 upload_max_filesize = 2M post_max_size = 8M ; vendorTimezone() converts per-vendor; this is the fallback the host uses. It ; must match the host value or dates shift for vendors with no timezone set. date.timezone = Asia/Kolkata ; --------------------------------------------------------------------------- ; MySQL UNIX SOCKET — required, not cosmetic. ; ; config/paths.php resolves DBHOST to the literal "localhost", and for PHP's ; MySQL drivers "localhost" means a UNIX SOCKET: the port is ignored entirely. ; The php:7.4 image leaves pdo_mysql.default_socket EMPTY, so it falls back to a ; compiled-in path that does not exist here, and every connection fails with ; SQLSTATE[HY000] [2002] No such file or directory ; while TCP to 127.0.0.1:3306 works perfectly. That combination is confusing ; enough to burn an afternoon. ; ; The host's socket is bind-mounted to this exact path by docker-compose.yml ; (target is fixed; MYSQL_SOCKET selects where it lives on the host), so the ; container's "localhost" behaves identically to the host's. ; ; Setting DBHOST to 127.0.0.1 instead would also work, but that literal is ; shared with the host's own php-fpm — changing it would switch the HOST site ; from socket to TCP as a side effect of packaging. Not acceptable. ; --------------------------------------------------------------------------- pdo_mysql.default_socket = /var/run/mysqld/mysqld.sock mysqli.default_socket = /var/run/mysqld/mysqld.sock ; validate_timestamps=1 so edits to bind-mounted source take effect on refresh ; without a container restart. For an immutable production image (source COPYed, ; not mounted) set validate_timestamps=0 and revalidate_freq high — that is a ; measurable win, but it makes the bind-mount dev loop confusing, so it is off ; here rather than in a shared file. opcache.enable = 1 opcache.validate_timestamps = 1 opcache.revalidate_freq = 0 opcache.memory_consumption = 256 opcache.max_accelerated_files = 20000 ; display_errors stays OFF. paths.php and several legacy includes emit notices ; on every request (undefined $_SERVER keys under CLI, deprecations from ; vendor/); with display_errors on, those get printed INTO json_encode() ; responses and break every API client. display_errors = Off display_startup_errors = Off log_errors = On error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT