Case Study

WordPress pages hung for five minutes, and PHP was busy doing nothing: the ionCube loader and the OPcache optimizer were stuck in a loop

During a server migration, the first WordPress site moved to the new server would not load. Every full page hung for about five minutes until the web server gave up, while a test PHP file and WordPress’s command line worked normally. PHP was running at full CPU without touching the disk, the network or the database. A debugger showed it spinning between the ionCube loader and OPcache, and three test runs isolated one setting. We turned off the OPcache optimizer, kept the cache, and the page loaded in 2.2 seconds.

July 2026  ·  4 min read

SECTOR

Business moving its hosted websites to a new server

SCALE

Plesk server migration, WordPress sites

PLATFORM

CloudLinux 10, Plesk Obsidian, PHP 7.3 under FastCGI, ionCube Loader 14.4, OPcache

ENGAGEMENT

Incident during migration: page renders hung

≈300 s → 2.2 s

Homepage render time, hung before the fix, warm after it

0 syscalls

Made by the hung PHP process in 3 seconds of tracing at 99% CPU

11 PHP builds

Given the same one-line fix, because the loader is loaded on all of them

Environment

Three runs of the same pageThe same WordPress homepage was requested three times. With OPcache off it rendered. With OPcache at its defaults it hung until the timeout. With OPcache on but its optimizer off it rendered.Three runs of the same page, one setting changed each timeWordPress homepagePHP 7.3 + ionCubeLoader 14.4OPcache offfull page, 276 KBOPcache defaultshangs until the timeoutOPcache on, optimizer offfull page rendersThe fixoptimization_level=0caching stays ongdb, while hungionCube + opcache.so99% CPU, 0 syscalls

Scroll the diagram sideways to see all of it →

One setting separated a page that rendered from a page that never finished.

The problem

A page that never finished. The site had been copied to the new server and switched to the same PHP version it used before. Every full WordPress page then hung for about five minutes until FastCGI’s read timeout ended it, and nginx logged that the upstream had closed the connection early. Not everything was broken: a phpinfo() test file returned 200 straight away, and WP-CLI worked against the same site. So PHP started, the files were in place and the database was reachable. Something inside a real page render never came back.

Investigation

Rule out waiting, then look at what PHP was doing. Along the way we found and fixed a separate migration trap: the new server still resolved the site’s own name to the old server, so any request the site made to itself went to the wrong machine. It was pinned to the new server for the duration of the move. The hang stayed. The database connected in 0.008 s and its process list was empty, so PHP was not waiting on a query. The PHP process sat at about 99% CPU, and a 3-second strace recorded no system calls at all: no disk, no network, no database. It was looping in user space. A gdb backtrace of the stuck process showed the PHP executor, the ionCube loader and opcache.so, spinning. None of the site’s plugins or themes was ionCube-encoded, but the loader is loaded globally and hooks every script PHP compiles.

The process was at full CPU and made no system calls. That rules out waiting. PHP was stuck in a loop.

What we can and cannot prove

Three runs, one setting changed each time. We requested the same homepage three times. With opcache.enable=0 it rendered the full 276 KB page. With OPcache at its defaults it hung until the timeout. With OPcache on and opcache.optimization_level=0 it rendered again. That points to the combination of ionCube Loader 14.4 and OPcache’s optimizer passes on this build, not to either one alone. We did not identify the exact code path inside the loader or the optimizer, and we did not measure what switching the optimizer off costs in speed. The optimizer only rewrites compiled code; OPcache still caches the compiled scripts, which is where most of its benefit comes from.

At a glance

Challenge

Right after a migration, every full WordPress page on the first site hung for about five minutes. A test PHP file and WP-CLI worked.

Approach

PHP at 99% CPU with zero system calls; gdb showed the ionCube loader and OPcache spinning; three test runs isolated the optimizer.

Result

OPcache optimizer switched off, caching kept, on all eleven PHP builds. Homepage 200 in 4.1 s cold and 2.2 s warm.

The fix

  1. One drop-in file per PHP version: 99-ioncube-opcache-fix.ini with opcache.optimization_level=0, so it survives package updates and is easy to remove later
  2. Keep OPcache on: only the optimizer passes are disabled, compiled scripts are still cached
  3. Restart and test the affected site first: PHP 7.3, then the homepage again
  4. Roll it to every PHP build on the server: all nine Plesk versions plus the CloudLinux builds, because the loader is loaded globally and the remaining sites had not been moved yet
  5. Read the setting back on each version, then restart the web server and PHP services

Outcome

The page loaded, and the rest of the migration went ahead. The homepage returned HTTP 200 with the full 275,747-byte page, in 4.1 seconds cold and 2.2 seconds warm. The fix was applied to every PHP version before the remaining sites were moved, so we do not know how many of them would have hit the same loop; some may never have. What is not here: a speed comparison with the optimizer on, because with it on the page never finished. The lesson we take: when PHP hangs at full CPU with no system calls, stop looking at the database and the network, and start switching extensions off one at a time.

More case studies

OPcache Full, WordPress Slow

66% → 99.4% PHP cache hit rate after the fix

41 GB WordPress News Site Migration

76,548 posts, the same count on both servers

99 cPanel Accounts to CloudLinux

99 / 99 accounts moved in 36 minutes

Moving servers and something will not load?

We trace hangs down to the process, fix the cause, and move your sites without surprises on the new server.