44 articles
Knowledge Base
PHP
44 articles in the PHP category · page 2 of 2.
- Configuring PHP opcache for production Size opcache.memory_consumption to the codebase, disable timestamp checks, and pick the validation strategy that fits your deployment model.
- PHP sessions with Redis: replacing disk sessions in production Move PHP session storage from local disk to Redis to enable horizontal scaling, reduce I/O contention, and gain atomic session locking without changing application code.
- PHP 8.1 Fibers: cooperative concurrency without a framework How PHP 8.1 Fibers work, where they fit in production workloads, and how to use them for cooperative concurrency without an event loop framework.
- PHP-FPM graceful reload and zero-downtime restarts PHP-FPM supports signal-based graceful reloads that replace workers without dropping in-flight requests. Learn the signals, the timing, and where it can still go wrong.
- PHP realpath_cache: tuning for frameworks with many include files PHP stat()s every include path on first use. Size realpath_cache_size and realpath_cache_ttl correctly to eliminate filesystem overhead in large frameworks.
- PHP 8 JIT: when it helps, when it does not, how to configure it PHP 8 JIT accelerates CPU-bound code but adds no value for typical I/O-bound web requests. Learn which workloads benefit and how to configure jit_buffer_size safely.
- PHP extensions for production: what to enable, what to disable Which PHP extensions belong on a production server, which ones carry security or performance risk, and how to audit your loaded extension set systematically.
- PHP-FPM status page: what every metric means PHP-FPM's built-in status page exposes real-time pool health metrics. Learn what each field means, how to expose it safely, and which numbers to alert on.
- PHP error reporting in production: what to log, what to hide Configure PHP error reporting, display_errors, and log_errors correctly in production to surface actionable data without leaking internals to users.
- Profiling PHP in production with Blackfire and Tideways Compare Blackfire and Tideways for continuous PHP profiling in production, covering agent architecture, overhead, sampling modes, and integration with CI and alerting.
- PHP-FPM slow log: finding the requests that drag performance down Enable and parse the PHP-FPM slow log to identify slow stack traces, correlate them with application paths, and prioritise what to fix in production.
- Using Xdebug safely in production: step debugging without killing performance How to install Xdebug on a production server, gate it behind a trigger so it only activates per-request, and avoid the overhead that makes it dangerous by default.
- Composer optimizations for production: autoload, classmap, and cache How to squeeze maximum performance from Composer in production using classmap generation, APCu cache, and deterministic install flags.
- PHP memory_limit: measuring real consumption before you raise it Use memory_get_peak_usage(), Blackfire, and FPM slow-log to quantify actual PHP memory consumption before adjusting memory_limit in production.
- PHP-FPM pool sizing: pm.max_children done right Calculate pm.max_children from real per-worker RSS and host memory, pick between static and dynamic process management, and avoid the cargo-cult numbers.
- Calculating PHP-FPM pm.max_children without guessing Derive a correct pm.max_children value from measured worker RSS, available RAM, and competing services — no arbitrary defaults or copy-pasted numbers.
- Detecting and fixing PHP memory leaks in long-running processes PHP-FPM workers, queue consumers, and CLI daemons accumulate memory across requests. Identify real leaks from normal growth using RSS trends, gc_collect_cycles, and Xdebug.
- OPcache warm-up strategies: preloading and on-hit priming Eliminate cold-cache latency spikes after deploys by using preload scripts and request-driven priming to fill OPcache before production traffic hits.
- PHP-FPM process manager modes: static, dynamic, ondemand Compare PHP-FPM static, dynamic, and ondemand process manager modes and learn which mode to choose based on traffic patterns and memory constraints.
- Installing PHP-FPM on Ubuntu with the right defaults Install PHP-FPM 8.x on Ubuntu, point Nginx at the FPM socket, and adjust the pool defaults that ship inappropriately tuned for a real server.