How to Increase Php Memory Limit in Hostinger Hpanel in 2026


Why You Need to Increase PHP Memory Limit on Hostinger

Running into sticky situations with your website and hitting memory limits? You're not alone. Figuring out how to increase PHP memory limit in Hostinger hPanel is a common need for many website owners and developers.

It's often the key to unlocking smoother performance for your site.

As of 2026, most standard web hosting plans come with a default PHP memory limit that can range from 64MB to 128MB. This is set to ensure fair resource distribution across shared servers, but it can quickly become insufficient for more demanding applications or complex WordPress setups.

Quick Answer

To increase your PHP memory limit in Hostinger hPanel, access the PHP Configuration tool. Locate the 'Memory Limit' setting and select a higher value, typically from 128MB up to 1024MB or more. Save your changes.

Alternatively, edit the php.ini file in your site's root directory to set the memory_limit directive.

Hostinger's PHP Memory Limit Explained

So, what exactly is this "PHP memory limit," and why does it matter? Think of it as a maximum allowance of RAM that your website's PHP scripts can use at any given time. When a script needs more memory than it's allocated, it hits a wall and throws an error, most commonly an "Allowed memory size of X bytes exhausted" message.

hPanel PHP configuration

Image source: Pixabay / Pexels (Pixabay Content License)

This limit is a safeguard. In shared hosting environments, it prevents one runaway script from consuming all server resources, which would impact other users on the same server. For your own site, it means that your scripts, like your content management system (CMS), plugins, or custom code, must operate within these defined boundaries.

If they need more, you'll see errors.

Method 1: Easiest Way – Using Hostinger's PHP Configuration

Hostinger's hPanel offers a dedicated tool to manage your PHP settings, making this process much simpler. This is usually the first and best place to start.

Adjusting Memory Limit in hPanel

  • Log in: Access your Hostinger account dashboard.
  • Open hPanel: On the left-hand sidebar, find and click on "Website."
  • Locate PHP Settings: Within the website management area, look for an option labeled "PHP Configuration" or similar.
  • Find 'Memory Limit': You'll see various PHP directives. Scroll or search for 'Memory Limit'.
  • Set the New Value: Typically, this is a dropdown menu or an input field. You can select values like 128M, 256M, 512M, or even 1024M. Choose a value that's a reasonable increase from your current limit.

Hostinger PHP Configuration tool

Image source: Pixabay / Pexels (Pixabay Content License)

Saving Your Configuration Changes

After selecting your desired memory limit, it's crucial to save these changes. Look for a "Save" or "Update" button, usually located at the bottom of the section or page. Click it to apply your new settings.

The server may take a minute or two to fully implement these changes across your site.

Method 2: Editing php.ini Directly

If you can't find the PHP Configuration option easily, or if you prefer manual file editing, you can directly adjust the php.ini file. This file holds all your PHP settings.

Accessing File Manager

  1. Log back into your Hostinger account and navigate to your hPanel.
  2. Go to 'Files': Find the "File Manager" option.
  3. Open your site's root directory: This is usually a folder named public_html.

Hostinger File Manager

Image source: Pexels / Pixabay (Pexels License)

Creating or Editing php.ini

  • Check if php.ini exists: Look for a file named php.ini within the public_html folder.
  • If it exists: Click on the file to open it in the editor.
  • If it doesn't exist: Click the "+ File" button, name it php.ini, and then open it for editing.

Setting the Memory Limit Value in php.ini

Inside the php.ini file, you need to add or modify the memory_limit directive. It should look something like this:

memory_limit = 256M

Replace 256M with the amount of memory you want to allocate (e.g., 512M for 512 megabytes, 1024M for 1 gigabyte). The M signifies megabytes. If you find a line already set, simply change the value.

Saving php.ini Changes

Once you've made the edit, click the "Save" or "Update" icon within the File Manager's editor to store your changes.

Confirming Your New Memory Limit

After making changes, it's vital to verify that your new memory limit is active and correctly applied. This confirms your effort paid off and your site can now use the increased resources.

Using a PHP Info Page

A common and effective way to check is by creating a phpinfo() page.

  1. Create a new file: In your public_html folder, create a file named info.php.

  2. Add the code: Paste the following into the info.php file:

    <?php
    phpinfo();
    ?>
    
  3. Visit the page: Open your web browser and go to yourwebsite.com/info.php (replace yourwebsite.com with your actual domain). Look for the line that says memory_limit. It should display your newly set value.

  4. Delete the file: For security reasons, remember to delete info.php from your server immediately after checking.

PHP Info page example

Image source: Pexels / Google DeepMind (Pexels License)

Checking Your Website's Backend

If you're using a CMS like WordPress, many themes or plugins offer a Site Health tool or system information panel. This often displays your current PHP memory limit directly, providing a quick check without needing a separate file.

Common Mistakes When Increasing PHP Memory

While increasing the memory limit seems straightforward, a few common missteps can cause headaches. One of the most frequent errors is simply setting the limit too high without understanding the underlying problem. This can mask inefficient scripts or plugins that are consuming excessive resources, and it might not even fully resolve your issue.

common website errors

Image source: Pixabay / jamesmarkosborne (Pixabay Content License)

Another mistake is incorrectly formatting the value in php.ini (e.g., forgetting the 'M' for megabytes) or not saving the changes. Sometimes, aggressive caching configurations can also make it seem like changes haven't taken effect immediately. Lastly, assuming the highest possible value is always best is a bad idea; start with a moderate increase and only go higher if necessary.

When to Consider Other Solutions

Sometimes, simply increasing the PHP memory limit won't solve your website's performance issues. If you've bumped the limit to, say, 512MB or even 1024MB and are still seeing errors or experiencing slow loading, the problem might lie elsewhere. Your website's code could be inefficient, or a particular plugin or theme might be the culprit.

This often happens with complex themes or plugins that are not well-optimized. They might make too many database queries or load too many assets at once. In such cases, the solution isn't just more memory; it's about optimizing the code or function that's requesting it.

Hostinger Plan Limits & Resources

It's also important to remember that your Hostinger hosting plan has overall resource limits. While you can increase the PHP memory limit, there's a maximum that your specific plan allows. Pushing PHP memory to its absolute limit might also strain other server resources like CPU or bandwidth.

Manufacturer specifications from Hostinger confirm that higher-tier plans generally offer greater resource allocations, including higher potential PHP memory limits. If your website consistently requires more memory than your current plan allows, even after optimization, you might need to consider upgrading your hosting package. This can alleviate resource constraints and provide a more robust environment for your growing site.

Optimizing Your WordPress Site

For WordPress users, increasing memory can be a temporary fix, but it's wise to investigate underlying performance bottlenecks. Over-optimized themes and plugins are common culprits for high memory usage. Regularly review your installed plugins, deactivating and deleting any that aren't essential or are known to be resource-heavy.

Our research indicates that many page builders and complex e-commerce plugins can significantly increase memory requirements. Keeping your CMS, themes, and plugins updated is also crucial. Updates often include performance improvements and bug fixes that can reduce memory consumption.

Debugging Inefficient Scripts

If you're comfortable with code or have a developer, they can help debug specific scripts that are causing memory exhaustion. This involves profiling the code to identify which functions or processes are consuming the most memory. Sometimes, a simple change in how data is processed or how loops are structured can drastically reduce memory needs.

For example, a script that loads an entire large database table into memory at once can be rewritten to fetch and process data in smaller, manageable chunks. This technique, known as batch processing or iterative processing, significantly lowers the peak memory requirement. It's a proactive approach to managing resources efficiently.

Frequently Asked Questions

How long does it take for the PHP memory limit changes to take effect?

Changes typically take effect within one to five minutes. Hostinger's system needs a short period to update the server configurations. If you don't see the change reflected immediately, try clearing your website's cache or waiting an extra few minutes.

Can I set an unlimited PHP memory limit?

While you can often set a very high limit like 1024M or more, an truly "unlimited" option isn't usually advisable or available on shared hosting. An excessive memory limit can still overload your server or mask underlying issues within your scripts, leading to instability rather than better performance.

What happens if my website still crashes after increasing the memory limit?

If your site continues to experience "out of memory" errors or crashes, the problem is likely not just the PHP memory limit. You might have an inefficient plugin, a poorly written script, a database issue, or you may have hit the overall resource limits of your hosting plan. Investigate these other potential causes or consult your hosting provider.

Leave a Comment