Need to fix PHP2Shell on a site with no PHP developer? Recover access, test backups and identify the runtime before choosing a patched build, migration or static archive.

01

Recover control before changing software

Find the domain registrar, hosting account, server or panel access, source files, database credentials and billing owner. Record who can approve a maintenance window and restore service. Identify the application from local files and its exact release, not the visible theme. If credentials or the source are missing, recover them before a production PHP switch.

02

Preserve evidence and rehearse restoration

If compromise is suspected, retain access, error and application logs before cleanup and follow the incident-response guide. Back up code, database, uploads, configuration and scheduled jobs as one dated set. Record encoding and external storage. Restrict and encrypt backups; restore to a private environment and verify content and login. A successful backup message is not a restore test.

Patching does not rule out compromise ↗

03

Map the PHP generation gap

PHP 5.3/5.6 applications can depend on mysql_* and other removed APIs. PHP 7 removes ext/mysql; PHP 8 removes each() and create_function() and tightens signatures and types; PHP 8.2 reports dynamic-property deprecations. Read every crossed migration guide. Old framework minima are historical facts, not supported deployment choices. A matching PHP number alone cannot validate custom code.

04

Choose repair, staged migration or an archive

A verified vendor patch on the existing branch may reduce urgent exposure while compatibility work proceeds; require evidence for both CVEs and check ongoing support. Unsupported PHP needs a supported migration target, not a permanent WAF exception. Repair an actively used application when ownership and tests exist; rebuild when dependencies are abandoned; consider a static archive for content-only sites after removing login, search and forms that need a backend.

05

Build a representative private rehearsal

Match Web PHP, extensions, INI, database and web-server routing to the planned target. Keep sanitized copies access-restricted and prevent staging from sending real mail, charging cards or calling production webhooks. Update framework, plugins and custom code as a compatible set. Exercise the product-specific business checklist and save logs and observed results. Non-technical owners can ask the host for these records.

06

Design rollback around writes and schema changes

Keep a matched application-and-database restore set. A PHP selector rollback cannot reverse a schema migration. Before final copying, coordinate an order/content write freeze or a documented synchronization method. Set failure criteria, a responsible operator and a time limit. Account for orders written after the snapshot; test restoration and data reconciliation instead of discarding customer transactions.

07

Verify the running service after cutover

Confirm the PHP actually serving the domain, every FPM pool, queue worker, scheduled task, container and replica. Replace old workers and check startup errors. Verify both CVE fixes using upstream versions or vendor backport advisories, then test deep links, login, uploads and business flows. Keep logs and a monitored rollback window. CLI php -v and a working home page are insufficient.

PHP2Shell patch verification ↗

Check site functions after the PHP2Shell fix

Login, sessions and roles

Sign in, sign out and reset a test password. Check session persistence, administrator access and role restrictions after a fresh browser session.

Deep links and HTTP status

Open an existing deep link, submit a form and request a missing page. Compare route parameters, redirects and HTTP status codes with the original site.

Database reads and writes

Read and write representative records in the test database. Check PDO/MySQL drivers, strict SQL behavior, transactions and data round-trips, not just connection success.

Custom templates and escaping

Render article, listing, account and error templates. Compare custom tags, escaping and compiled-template caches; capture warnings from the application log.

Uploads and thumbnails

Upload a harmless test image, retrieve its thumbnail and remove it. Verify permissions, storage paths and URLs without allowing executable uploads.

Existing and new queue jobs

Process a newly queued test job and an existing queued job with the new worker. Confirm retries, serialization and worker replacement without duplicate business actions.

Scheduled tasks and PHP paths

Inspect the scheduler’s actual PHP binary, INI and service account. Run a harmless scheduled task in staging and confirm the same runtime is used after deployment.

Cold/warm caches and OPcache

Rebuild application/container caches using the documented procedure. Test cold and warm requests and ensure stale serialized values or old OPcache workers are removed.

Test mail delivery

Send password-reset and order messages to a test mail sink. Check rendering, queue delivery and transport errors without sending staging mail to real customers.

Orders, tax and inventory

Complete a sandbox order with shipping, tax, discounts and refunds. Compare totals, inventory updates and order history before accepting production orders.

Sandbox payments and callbacks

Exercise sandbox payment success, failure and asynchronous notification. Verify signatures and idempotency so retries cannot create duplicate charges or orders.

Sites, domains and languages

Check each site, domain and language with an account of the correct role. Verify shared cookies, URL mappings and site-specific configuration.

GBK/UTF-8 and data round-trips

Round-trip Chinese/Japanese text and special characters through forms, DB and export. Preserve the original GBK/UTF-8 choice until a separately tested conversion.

API contracts and callbacks

Test authenticated and unauthenticated API requests. Compare JSON types, validation errors, status codes and integration callbacks against the old behavior.

Web/CLI extensions and ABI

Confirm required extensions load in Web PHP and CLI with the correct ABI and NTS/ZTS build. Check drivers and services rather than trusting php -m alone.

PHP2Shell patch verification

Application compatibility, application support and PHP security are separate checks. Choose a supported PHP branch with both CVE fixes, then verify every Web worker, scheduled task and replica. Updating a framework or plugin alone does not replace the PHP interpreter.

Four branches. A clear upgrade target.
PHP branchUpstream releases belowFirst patched releaseSecurity support ends
PHP 8.5< 8.5.12✓ 8.5.12Dec 31, 2029
PHP 8.4< 8.4.27✓ 8.4.27Dec 31, 2028
PHP 8.3< 8.3.36✓ 8.3.36Dec 31, 2027
PHP 8.2< 8.2.35✓ 8.2.35Dec 31, 2026
Running PHP 8.1 or older?

No normal PHP project release is available for these branches. Minimal source backports exist for 7.4, 8.0 and 8.1; vendor support must be verified separately. Read guide ↗

Original source

PHP security teamOriginal source ↗CVE-2026-109618Original source ↗CVE-2026-109619Original source ↗PHP 7.0Original source ↗PHP 8.0Original source ↗PHP 8.2Original source ↗PHPOriginal source ↗ComposerOriginal source ↗
PHP2Shell repair - solve PHP upgrade errors ↗← Back to application guides