Cloudflare Error 524 ("A timeout occurred") means Cloudflare connected to your origin, sent the request, and then waited 100 seconds without receiving a response. The server is up, but the page or script behind it is too slow. Fixing a 524 error means finding what takes so long.
Before you start
- The URL that times out (often an import, export, report or admin page).
- Access to cPanel logs and, ideally, the application's admin area.
Common causes of Cloudflare Error 524
- Long-running PHP tasks such as imports, backups, bulk emails or image regeneration started from the browser.
- Slow database queries on large tables without indexes.
- External API calls that hang while the page waits.
- Resource limits slowing the account down until it crawls.
How to fix error 524
- Identify the slow URL. Check cPanel → Metrics → Raw Access for requests at the error times; the URL tells you which feature is slow.
- Run long tasks outside the browser. Move imports and exports to a cron job or WP-CLI over SSH, where Cloudflare's 100-second limit does not apply.
- Bypass Cloudflare for admin tasks. Create a DNS-only (grey cloud) subdomain such as
direct.example.compointing to the same server for occasional long admin operations. - Optimise the database. Find slow queries and add indexes, or clean up large tables.
- Check resource usage in cPanel → Metrics → Resource Usage; if you hit CPU or I/O limits, see I/O limits and slow websites.
- Set timeouts on outgoing API calls so one slow service cannot hang the page.
Note: Raising PHP max_execution_time does not fix a 524. Cloudflare stops waiting at 100 seconds on most plans no matter how long PHP is allowed to run.
What to check afterwards
Time the page with curl -o /dev/null -s -w '%{time_total}\n' https://example.com/page. It should finish well under 100 seconds.
FAQ
Does the task keep running after a 524?
Often yes: the origin keeps working even though Cloudflare gave up. Check the result before starting it again.
Can I increase Cloudflare's 100-second timeout?
Only on Enterprise plans. For everyone else, make the request faster or run it outside the proxy.
Is 524 the same as 504?
Similar idea: 524 is Cloudflare's own timeout; 504 comes from a gateway on your server.
