LifterLMS Memory Limit and Timeout Errors: Causes and Fixes

Fix "Allowed memory size exhausted", maximum execution time and 502/504 errors on LifterLMS sites: which tasks use the most resources, which limits to raise, and when raising them is the wrong fix.

  • Add as a preferred source on Google
Illustration for “LifterLMS Memory Limit and Timeout Errors: Causes and Fixes”

An export stops half way. The course builder spins and never saves. A reporting screen shows a blank page, a "critical error" message or a 504 Gateway Timeout. Behind most of these is the same thing: PHP ran out of memory or time before the job finished.

This guide explains how to confirm a LifterLMS memory limit or timeout error, which limits are involved and how to raise them properly, and which LifterLMS tasks are most likely to hit them. It also covers the cases where raising limits only hides a problem you should fix.

It is for site owners who can edit wp-config.php or ask their host to, and for developers tuning larger sites.

Recognise the error

These errors look different depending on where the limit was hit:

What you seeWhat it means
Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in the PHP error logPHP reached its memory limit (here 256 MB) and stopped
Maximum execution time of 30 seconds exceededPHP's own time limit for one request was reached
"There has been a critical error on this website", or a blank pageA fatal error, often one of the two above; check the log to be sure
502 Bad Gateway or 504 Gateway TimeoutThe web server or proxy gave up waiting for PHP; the PHP process may have been killed by a server timeout
Cloudflare error 524Cloudflare waited around 100 seconds for a response and gave up

Enable the PHP error log before you change anything, using the WP_DEBUG_LOG settings in the WordPress debugging guide. The log line tells you which limit was hit and, often, which plugin file was running. If the site is down completely, our guide to LifterLMS white screens and fatal errors covers recovery first.

Check your current limits

Go to LifterLMS > Status and open the System Report. The Server section lists, among other things:

  • the PHP memory limit, which is the hard ceiling set by PHP;
  • the WordPress memory limit, which is what WordPress asks for on normal requests (WP_MEMORY_LIMIT);
  • the PHP time limit, which is the maximum execution time in seconds;
  • the PHP post max size and maximum upload size, which cap form submissions and file uploads;
  • PHP max input vars, the number of fields a form may send.

Copy the report with Copy for Support before you change anything, so you can compare afterwards.

Which LifterLMS tasks use the most memory and time

Normal student page views are light. The heavy work is almost always on the admin side or in background jobs:

  • Reporting. Course and student reports with many enrollments, and sales and enrollment widgets over long date ranges, run large database queries. Our guide to slow LifterLMS admin and reports covers the database side.
  • Exports. CSV exports from reporting tables are built in chunks of 250 rows per request by default and written to a temporary file in uploads/llms-tmp. A chunk that includes heavy calculated columns, such as grades and progress, can still exceed the limits on a slow server.
  • Course import. Imports run in a single request. Every course, lesson and question is created, and images referenced in the content are downloaded into your Media Library. A large file with many images is the classic import timeout.
  • Course builder saves. Saving a course with hundreds of lessons and questions sends a lot of data at once.
  • Background processors and database updates. These are designed to stop at around 20 seconds or 90% of the memory limit and continue in the next request, so they rarely cause errors themselves. If a single item within them is too big, the same item fails every time.
  • Protected media. When protected files are read through PHP rather than handed to the web server, large files keep a PHP process busy for the whole download.

How to raise PHP and WordPress memory limits

Three settings interact, and people often change the wrong one.

  1. PHP's memory_limit is the real ceiling. It is set in the server's PHP configuration, usually through your hosting control panel or a request to your host. Nothing in WordPress can go above it on most hosts.
  2. WP_MEMORY_LIMIT is what WordPress requests for normal page loads. The wp-config documentation says WordPress tries to raise memory to 40 MB by default on single sites and 64 MB on multisite.
  3. WP_MAX_MEMORY_LIMIT applies to admin screens and some heavy tasks. WordPress sets it to 256 MB unless you define it.

A sensible starting point for a LifterLMS site, placed in wp-config.php before the line that loads wp-settings.php:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

These only work if PHP's own limit is at least as high. Ask your host to set memory_limit to 512M if your plan allows it, then confirm the change in the System Report. If the report still shows the old figure, the host's setting is overriding yours.

How to fix LifterLMS timeout errors

A timeout can come from three places, and the lowest one wins:

  • PHP's max_execution_time. This is the time limit row in the System Report's Server section. 60 to 120 seconds is reasonable for an admin-heavy site.
  • The web server or PHP-FPM. Nginx's FastCGI read timeout, Apache's timeout and PHP-FPM's request timeout can all end a request first. Only your host can change these on managed hosting.
  • A proxy or CDN. Cloudflare and similar services close the connection after a fixed time regardless of your server settings. Long admin tasks behind a CDN should be made shorter rather than given more time.

Raising timeouts is fine for genuine one-off jobs such as an import. As a permanent fix for slow pages, it just lets slow requests tie up more PHP workers, which makes the whole site slower under load.

Make heavy tasks smaller instead

For repeat problems, reduce the size of each request. Some options:

Smaller export chunks

If CSV exports time out, a developer can make each chunk smaller with the llms_table_generate_export_file_per_page_boost filter. The export takes more requests but each one is lighter:

add_filter( 'llms_table_generate_export_file_per_page_boost', 'llmsx_export_chunk_size' );
function llmsx_export_chunk_size( $per_page ) {
	return 100;
}

Split large imports

Export courses one at a time rather than in one bulk file, and import them separately. If images in course content are the slow part, a developer can turn off image downloading during import with the llms_generator_is_image_sideloading_enabled filter and move media separately. Our guide to LifterLMS course import failures covers this.

Run long jobs from the command line

WP-CLI is not bound by web server timeouts. Enrollments, reports and data clean-ups that time out in the browser can often be run as WP-CLI commands or scheduled jobs instead. See our LifterLMS WP-CLI guide.

Look for the real consumer

When a simple page runs out of memory, the cause is usually something loading too much data: a plugin querying every user, a report widget with an unbounded date range, or a page builder rendering huge layouts. Tools such as Query Monitor show memory use and slow queries per request and point to the plugin responsible.

Common mistakes

  • Setting WP_MEMORY_LIMIT higher than PHP allows and assuming it worked. Always check the System Report afterwards.
  • Using -1 (unlimited) memory on production. One runaway request can then exhaust the whole server.
  • Raising limits instead of fixing an unbounded query. If memory use grows with your number of students, it will hit any limit eventually.
  • Forgetting the cron and CLI PHP settings. Server cron jobs and WP-CLI often use a different PHP configuration with different limits.
  • Adding max_input_vars as a memory fix. It is a different problem: if settings or menus silently lose fields when saved, raise max_input_vars; it does not affect memory errors.

Frequently asked questions

What memory limit does LifterLMS need?

LifterLMS has no special requirement beyond WordPress itself. In practice 256 MB for normal requests and 512 MB for the admin is comfortable for most course sites.

Why does the error only happen in reports or exports?

Those screens calculate data for many students at once. Normal pages only deal with one student. Make the task smaller or the queries faster rather than only adding memory.

Will a bigger hosting plan fix timeouts?

It often helps, because more CPU makes each request faster. It will not fix a single request that tries to do too much; that needs the request made smaller.

Why does the import fail with an upload error?

If the message says the file exceeds upload_max_filesize, the file is bigger than PHP accepts. Raise the upload and post size limits, or split the export into smaller files.

What to do next

Find the exact error in the PHP log, compare it with the limits in the System Report, and raise the limit that was actually hit. If the same task keeps failing, reduce its size using the options above.

If your site has outgrown its hosting or its reports have become too slow to use, our LifterLMS optimization service profiles memory, queries and background jobs and fixes the causes. Contact us with your System Report and the error you are seeing.

Add LifterLMS Expert to your preferred sources

Add lifterlmsexpert.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.

  • Add as a preferred source on Google
Free consultation

Prefer expert help over DIY?

Skip the trial and error. Get specialist LifterLMS help and ship faster.

Talk to a LifterLMS Expert Explore our services

Replies within one business day