Last verified ·

PHP2Shell step-by-step response

Commands are examples for the stated environment. Match the branch, service and paths to your site; prepare a backup and a maintenance window before changing production.

Operation map - an illustration, not a screenshot of your installation
  1. If upgrading causes HTTP 500

    Keep the public site restricted. Read the first fatal error in private PHP/application logs and compare extensions, INI and Composer requirements. Restore the tested application/database/runtime set if necessary. Restoring a vulnerable runtime is a recovery step, not a security fix.

  2. Test the old application on a copy

    Restore a separate staging copy, select a supported patched PHP branch, then check Composer requirements and extensions. Test login, database, uploads, payments and jobs. Resolve removed APIs and plugin/framework incompatibilities; do not bypass platform checks to force installation.

    Composer · PHP 8.4.27
    composer check-platform-reqs
    composer prohibits php 8.4.27
    php -m
  3. Verify the fix on the running website

    Retain runtime/build evidence for both CVEs, restart timestamps and every pool/replica checked. Re-test business functions and effective temporary settings. A hidden response header or a clean URL-check result proves neither patching nor absence of compromise.

Resolve errors blocking your PHP2Shell fix: removed APIs, dependency conflicts, missing extensions and gateway failures. Restore service using a patched PHP runtime and verify both CVEs.

01

Undefined function: mysql_connect, each or create_function

First identify the actual PHP used by the failed request. ext/mysql was removed in PHP 7; each() and create_function() were removed in PHP 8. Update the maintained application/extension or refactor in a private copy. PDO/mysqli migration must preserve parameter binding and transaction behavior. Replacing function names blindly or installing an untrusted compatibility shim can introduce data and security failures.

02

TypeError or incompatible method declaration

Capture the full error, package and stack trace in restricted logs. Compare custom overrides with the target parent/interface signature and review changed parameter, return and internal-function rules. Update the responsible dependency or adapt tested code. Do not mass-remove type declarations: that can mask a contract error. Keep detailed errors out of public responses.

03

Dynamic-property deprecations on PHP 8.2

A deprecation message does not by itself mean RCE or compromise. Locate the class that creates undeclared properties; use a maintained release or a deliberate property/model fix. Test serialization and ORM behavior. Log warnings privately while removing their causes; suppressing all errors is not an application upgrade or a PHP2Shell fix.

04

Composer reports a platform conflict

Keep composer.json and composer.lock, then inspect locked packages and run check-platform-reqs --lock in a trusted working copy. Use prohibits to locate a blocking package for the chosen target. config.platform can emulate a PHP version during dependency solving; it does not change the running PHP. Do not use --ignore-platform-reqs as proof of compatibility. Review and test any lock-file change before deployment.

05

Missing intl, mbstring, PDO driver or compiled extension

Compare loaded INI files and modules for CLI and the domain’s Web/FPM runtime. Install a trusted extension build matching PHP, architecture and NTS/ZTS, enable it for the correct service and restart affected workers under a maintenance procedure. Verify the actual connection or function afterward. A module present in CLI may still be absent from the site.

06

502, blank page or old PHP still running

Correlate web-server upstream errors with FPM startup and application logs. Check the socket/port, pool permissions, service state and target binary after changing PHP. A worker can fail to start because of an incompatible extension. Test the configuration before a controlled reload; do not repeatedly switch versions without preserving logs. A 502 alone is not evidence of intrusion.

07

Broken characters, links or migrated data

Check source encoding, DB connection charset/collation, export encoding, rewrite rules and storage paths separately. Legacy GBK-to-UTF-8 conversion needs a rehearsal and comparison of byte-sensitive data, attachments and URLs. Avoid bulk search-and-replace in serialized values. Preserve canonical article paths or map deliberate changes with redirects after checking actual content and HTTP status.

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 for an unmaintained PHP site ↗← Back to application guides