Some time ago, I received an email from a client experiencing slow performance issues with a LEMP (Linux, Nginx, MySQL, and PHP web server). During a full audit, I found that the server’s load average was pretty low (see below screenshot). However, the website was indeed very slow. There were some misconfigurations, but one of […]
PHP 8: After 4 years, only 30% of PHP websites use it. But why?
Two years ago, one of our online community members discussed some of the reasons behind the slow adoption of PHP 8. One member stated that it’s due to PHP compatibility issues across new releases. In contrast, another put it down to the fact that important software/frameworks did not support PHP 8 until recently. I think […]
Set PHP realpath_cache_size ‘correctly’
In 2012, I started enabling PHP realpath_cache_size and realpath_cache_ttl for performance benefits. At the time, I followed the settings I found here (has since been deleted). It bugged me that I was blindly setting the cache size without knowing how much storage was actually being used. In this post, I will demonstrate how to view the […]
PHP performance: oPcache Control Panels
OPcache is a PHP extension that improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. The extension is built-in for PHP 5.5+. If you want to improve PHP performance, the first step should be to use PHP 8+, which […]
PHP Benchmarks: OPcache vs OPcache w/ Performance Tweaks
A few weeks ago, I wrote a short article highlighting GUI solutions for monitoring and controlling PHP OPcache. We all know that enabling PHP OPcache provides massive performance gains (see benchmark graph at the end of the article). In addition, since PHP 5.5, OPcache is now enabled by default. With these facts in mind, is […]
Guide to Optimizing PHP for High Traffic Sites
Note: This article serves as an overview and index, connecting you to previous detailed PHP optimization articles. For comprehensive insights on each topic, please follow the provided links to previous articles under the subheadings below. It made more sense to connect these articles here for your convenience, rather than trying to merge 12 articles covering […]
PHP 8.3 is Out! – 60% Still Using End-of-Life PHP 7
Yesterday, on November 23, 2024, the PHP community welcomed the release of PHP 8.3, marking another milestone in the evolution of this widely used scripting language. With PHP powering 76.7% of all websites with known server-side programming languages, upgrading PHP is critical in ensuring the security, efficiency, and overall user experience of a significant portion […]
PHP 8 Compatibility Check and Performance Tips
PHP 7 was first released back on 03 Dec 2015. It’s been around a while! The PHP team encouraged upgrading to PHP 7, hailing its improvements such as being twice as fast, consistent 64-bit support, removing old and unsupported SAPIs and extensions, and improved fatal error resistance, to name a few. A few years ago, […]
PHP memory_limit – understanding and increasing
PHP’s memory_limit is per-script, just as a highway’s speed limit is per-vehicle. For example, although PHP’s memory limit may be set to 1GB, that does not mean that scripts will pile up to use that 1 GB. Let’s take a closer look at understanding PHP’s memory_limit setting. PHP memory_limit is a per-script setting PHP.net’s […]
Memcache PHP Extensions for Memcached Caching Daemon
Memcached (Memcache Daemon) is a caching daemon designed especially for dynamic web applications to decrease database load by storing objects in memory. It is commonly used to speed up dynamic database-driven websites by caching data and objects in server memory to reduce the number of times the data source must be read. Memcached is free […]