What is the PHP memory_limit?

The PHP memory_limit is the maximum amount of server memory that can be used by any PHP script. It sets the memory limit for a single script while it’s running on the server.

The official PHP documentation explains this in more detail:

"This defines the maximum amount of bytes a script can allocate in memory. This prevents poorly written scripts from consuming all available memory on the server.”

Reducing memory consumption enables the server to perform better, be more stable and to be fairer between multiple websites hosted on the same environment.