← Back to knowledge

PHP

How to install multiple PHP versions on the same server

One server, several sites, different PHP versions. Here is how to install PHP 8.2, 8.3, and 8.4 side by side and point each site at the version it needs.

30 June 2026 PHP

How to install PHP on Ubuntu

A modern PHP install means more than one apt package — you need PHP-FPM and the right set of extensions for your application. Here is how to install PHP on Ubuntu and wire it into Nginx.

30 June 2026 PHP

Important PHP config options

The default php.ini is built to be safe, not to run a real website. These are the settings that actually matter in production and what to set them to.

30 June 2026 PHP

PHP file upload exceeds upload_max_filesize

When a file upload silently fails or is empty, PHP itself is usually rejecting it because it is larger than upload_max_filesize or post_max_size. This is the PHP-side companion to the nginx 413 error.

23 June 2026 PHP

PHP Warning: Undefined array key

PHP 8 turned accessing a missing array key into a warning instead of a silent notice. The fix is to check the key exists or provide a default before reading it.

23 June 2026 PHP

PHP Fatal error: Allowed memory size exhausted

This fatal error means a PHP script tried to use more memory than the configured limit. Raise the limit, but first ask why the script needs that much.

23 June 2026 PHP

PHP: Call to a member function on null

This error means you called a method on a variable that turned out to be null. The variable you expected to hold an object was empty, often a database lookup that found nothing.

23 June 2026 PHP

PHP Fatal error: Class "X" not found

This fatal error means PHP could not load a class you referenced. Almost always a namespace mismatch, a wrong file name, or an autoloader that needs regenerating.

23 June 2026 PHP

Composer out of memory (allowed memory size exhausted)

Composer can run out of memory while resolving dependencies, especially on small VPSes. The real fix is usually swap space, not a bigger memory limit.

23 June 2026 PHP

PHP Maximum execution time of N seconds exceeded

This fatal error means a PHP script ran longer than the allowed time limit and was killed. Raise the limit for legitimately long work, but the real fix is usually to make the script faster or move it to a queue.

23 June 2026 PHP

Enable JIT in PHP 8.x OPcache

Using OPcache can greatly improve [PHP performance](/php-performance). By enabling Just In Time (JIT) compiling in OPcache you can improve it even more.

21 November 2024 PHP

How to run PHP files

You cannot execute PHP files directly on your computer without any additional tools. You need a (local) webserver that can run the PHP files.

16 November 2022 PHP