Tutorial mengatasi fatal error allowed memory size


The “allowed memory kích thước exhausted” error is one of the most comtháng issues most WordPress web1_users often encounter, especially when using shared hosting plans.

Bạn đang xem: Tutorial mengatasi fatal error allowed memory size

If you’ve sầu been getting an error that says “Fatal error: Allowed memory size of x bytes exhausted”, that means either your hệ thống is limiting the amount of memory used by your website or a plugin is consuming too much VPS memory.

You can fix this error using two different methods. In this post, we’ll show you how to lớn fix this error within a few minutes and get your website up and running.

What Causes The “Fatal Error Allowed Memory Size Exhausted” Error?

As you may know, WordPress uses PHPhường. code and scripts for most of its functions. PHP is a server-side programming language that requires server resources khổng lồ exexinh đẹp scripts and actions. This means your WordPress system và all of the plugins that you install on your website consume server memory.

The “allowed memory size exhausted” error occurs when WordPress or one of your plugins is taking up too much VPS memory. When the VPS exhausts its allocated memory for your trang web, it gives you the “allowed memory size exhausted” error.

This usually happens when hosting a high-traffic and big websites using small shared hosting servers, which allocate very little amounts of PHP memory per each hosting plan.

To fix the error, you have sầu to lớn manually increase the mặc định PHPhường memory limit mix for your server.

What Is PHP Memory Limit?

The PHP. memory limit is the amount of memory that your VPS allocates for running PHP code and scripts used by WordPress and plugins. Different web hosting providers mix different amounts of memory for each of their hosting plans.

For example, some web hosting providers offer 256MB of memory per hosting account. That’s more than enough khổng lồ host a WordPress trang web with regular traffic. The memory exhausted errors only occur when your website host allocated lower amounts of memory for each trang web.

Method 1: Increase PHPhường Memory Limit

To increase the PHPhường memory limit, you need to lớn manually mix a new memory limit for your server. This involves editing the wp-config.php tệp tin located in the hệ thống.

You can use two methods lớn access the WordPress files in your VPS. You can either use the File Manager in CPanel or use an FTP.. client tiện ích. For the demonstration, we’ll show you how to lớn vì chưng it using the File Manager.


Step 1: Login khổng lồ your CPanel by typing /cpanel at the over of your domain name name (eg: yourwebsite.com/cpanel) use the login details you received from your website host in the welcome gmail to login khổng lồ CPanel.

Step 2: mở cửa the File Manager and locate the Public.html folder


Step 3: Find the wp-config.php tệp tin then right-cliông chồng & choose Edit.


Step 4: Search for the line that says “That’s all, stop editing! Happy blogging” & paste the following code right above sầu it.

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

This sets your mặc định PHPhường memory limit lớn 256MB.

Xem thêm: Top 6 Plugins Tạo Khung Đăng Nhập Cho Wordpress Không Cần Plugin

Step 5: Clichồng Save sầu to save the changes. Go baông chồng to lớn your website và reload lớn see if it fixes the error.

Note: Always make a backup copy of the files before editing them.

Method 2: Disable And Reactivate Plugins

Increasing the PHP memory limit usually fixes the memory exhausted error. If not, one of the plugins installed on your trang web might be causing the error.

You can kiểm tra khổng lồ see which plugin is causing the issue by disabling all of the plugins & then reactivating them one by one lớn find the culprit.

Since you can’t access your WordPress dashboard, you need to lớn disable the plugins from the VPS.

To bởi this, you need lớn login to lớn your server once again.

Step 1: Follow the steps in the first method to login to your hệ thống.

Step 2: mở cửa the wp-content thư mục & locate the plugins thư mục.


Step 2: Rename the plugins folder khổng lồ “plugins-bad”. Don’t worry, this won’t delete any of the installed plugins.


Step 2: Create a new empty folder & name it plugins.

This will disable all of the plugins installed on your website. Now, reload your trang web & see if it fixes the error. If your website is functioning as normal again, then the error was likely caused by a plugin.

Now, go back khổng lồ the wp-nội dung folder. Delete the empty folder that you’ve sầu created earlier & rename the “plugins-bad” folder back to lớn “plugins”. This will restore your old plugins without activating them.

You can now login to lớn your WordPress dashboard và reactivate the plugins to see which causes the error.

Still Having The Issue?

If you’re still getting the same error after following the above solutions, then it’s probably caused by a hệ thống issue & you should seek professional help.

Contact your website host’s technical support team và explain the situation. If you keep getting the same error, consider upgrading your current hosting plan to lớn a bigger plan. Or use a managed WordPress hosting account, which includes more optimized features for running WordPress websites.