Hide filters
Storage Space (minimum)
1 GB
  • 0
  • 125
  • 250
  • 375
  • 500
Domains included
1 Units
  • 0
  • 10
  • 20
  • 30
  • 40
  • 50
Number of Databases
0 Units
  • 0
  • 13
  • 25
  • 38
  • 50
Number of Web Projects
0 Units
  • 0
  • 3
  • 5
  • 8
  • 10
Contract Term max.
0 Months
  • 0
  • 6
  • 12
  • 18
  • 24
TOP Features
SSD
SSH
SSL
Backup
Renewable Energy
PHP8
Cron jobs
DDOS protection
http2 Active
Nginx Proxy
Location DE
Maximum Cost
0 £
  • 0
  • 25
  • 50
  • 75
  • 100
Recommendation Rate
0 %
  • 0
  • 25
  • 50
  • 75
  • 100
Satisfaction
Search Provider
Display
Number of Email Mailboxes
0 Units
  • 0
  • 25
  • 50
  • 75
  • 100
Email Features
Transfer volume (minimum)
1 GB
  • 0
  • 125
  • 250
  • 375
  • 500
Unlimited
PHP Memory Limit
128 MB
  • 0
  • 512
  • 1024
  • 1536
  • 2048
Features
  • Show more options
Operating system
Certifications
Webserver
Database
Applications
  • Show more options
WordPress Special
Scripting
  • Show more options
Control-Panel
  • Show more options
Server Location
  • Show more options
Payment Method
Minimum Cost
0 £
  • 0
  • 25
  • 50
  • 75
  • 100

What is the PHP Memory Limit and how can it be changed?

php-memory-limit-changePHP is a programming language that provides optimal conditions for web applications. It is used by almost all Content Management Systems (CMS) such as TYPO3, WordPress, Joomla, or Contao, and by e-commerce platforms like Shopware and Magento. Essential settings are stored in a central configuration file called php.ini, which can often be edited through the CMS or directly via a text editor. An important parameter in this file is the PHP Memory Limit.

What exactly is the PHP Memory Limit and how can it be adjusted individually is explained in the following article:

How does PHP work?

PHP belongs to the so-called scripting languages. This means that programs are written as easily understandable code. Subsequently, an interpreter takes over the processing by reading a program line by line and executing the instructions according to its php.ini. CMS such as Magento, WordPress, or Joomla consist of a variety of scripts, each performing a specific task. They are loaded into a specific area of the memory, which is limited by the PHP Memory Limit and can be increased individually. The PHP scripts are used to create a webpage in HTML format from various sources such as a database, external files, and special style sheets - the css files. This is complemented by client-side scripts written in other languages like Java or JavaScript, enabling interactive features such as games or animated menus. Suitable web hosting packages with PHP support can be found in the PHP Web Hosting Comparison.

What is the PHP Memory Limit and what is its purpose?

As mentioned earlier, PHP reserves a portion of the memory to store and execute scripts. The size of this area is defined by the PHP Memory Limit in the php.ini. The limitation imposed by the PHP Memory Limit protects a computer from being affected in its performance by poor or faulty programming. A simple example of this would be a loop that creates and stores a variable whose name and value increase by 1 with each iteration. Without a PHP Memory Limit in the php.ini, this would lead to the entire memory being occupied by this one loop over time. As a result, the loading times increase, and in some cases, the operating system itself may become unstable due to a lack of memory for its data.

How high should a PHP Memory Limit be in production operation?

In web hosting, the standard size of the PHP Memory Limit is usually between 32 MB and 64 MB. This is sufficient for the basic installation of a CMS like WordPress, Contao, Joomla, or TYPO3 and allows for stable operation. Complex plugins, large databases, or many extensions require more memory for the scripts and their data. In this case, instead of a webpage, PHP outputs an error message, which may state the following:

In this case, it is necessary to increase the PHP Memory Limit so that the interpreter has sufficient temporary memory available for the execution of all scripts. Recommended limits for a CMS range between 32 MB (WordPress) and 256 MB (Shopware) - more than 512 MB are rarely necessary and often indicate programming issues.

 

Find web hosting here with at least 128MB PHP Memory Limit:

 

WordPress Hosting Start
from IONOS UK more IONOS UK offers
no reviews Diamond
25 GB
Storage Space
0,0/5
Rating

Features
Zertifiziert nach ISO 27001
0€ Setup
Renewable Energy Usage
SSL Certificate Included
SSD Drive
HTTP2 Ready
Nginx Usable as Proxy
Server Side Includes Supported
FTP Access Possible
Cronjobs Supported
Pre-installed Scripts
Custom PHP Scripts Possible
Commercial Use
Private Use
£5.40* Average price per month £7.20/Month
UK WordPress Hosting Launch
from fasthosts more fasthosts offers
no reviews Verified
10 GB
Storage Space
0,0/5
Rating

Features
Money-back guarantee
0€ Setup
Renewable Energy Usage
Automatic Backup
SSL Certificate Included
SSD Drive
DDOS Protection
HTTP2 Ready
FTP Access Possible
SSH Access Possible
Cronjobs Supported
Pre-installed Scripts
Custom PHP Scripts Possible
Commercial Use
Private Use
£4.20* Average price per month £7.20/Month
* At hosttest, only a selection of providers can be found. Offers marked with an asterisk have additional conditions on the offer detail page. More information about our ranking and sorting details.

Didn't find the right one?

Now post an individual tender for free & without obligation and receive offers in the shortest possible time.

Start tender

How to Increase the PHP Memory Limit?

Most web hosting providers allow their customers to increase the PHP Memory Limit within certain limits. There are various ways to do this, not all of which are offered by every Internet Service Provider:

  • Method 1: Changing in the php.ini File

    The php.ini file actually contains the "global" configuration of the PHP interpreter - this means that changes in the php.ini file generally apply to the entire server. However, some providers also allow the creation of an individual php.ini file where their customers can make local settings. The php.ini file consists mostly of comments that extensively and clearly document the file and its functions. It contains a section on Resource Limits, where, in addition to the maximum script execution time, the PHP Memory Limit can be increased. It is set with the entry

    memory_limit = 64M

    - here it is set to 64 MB. With a Dedicated Server or VPS Hosting, customers are free to increase the PHP Memory Limit as they wish. However, with web hosting, the provider will typically prohibit customers from changing global configurations (which also affect other users).
  • Method 2: Using a .htaccess File

    In addition to the php.ini file, the PHP Memory Limit can also be increased in a .htaccess file. This file is located in the root directory of WordPress, TYPO3, Contao, or other CMS and contains instructions that are read and applied before executing a script. The key limitation is that .htaccess is only supported by an Apache 2 web server. To increase the PHP Memory Limit, simply create a file named .htaccess with the content

    php_value memory_limit 64M
  • Method 3 (WordPress): Defining in the config.php File

    Some CMS like WordPress allow the PHP Memory Limit to be increased in their local configuration file. To do this, open the file Installation/wp-config.php (WordPress) and insert the following new definition

    define('WP_MEMORY_LIMIT', '64M');

It is important to note that every web hosting space and Internet Service Provider limits the maximum PHP Memory Limit of their customers to control memory usage. The allowable maximum limit usually varies depending on the provider, ranging between 128 and 512 MB. Server monitoring should be a must-have for professionally operating a website.

Web hosting with at least 128MB PHP Memory Limit

Compare offers from suitable web hosting providers now

To Provider Comparison

Image credit: Image by Dok Sev from Pixabay


Articles related to this comparison