Your hosting provider recommends updating PHP, but your WordPress site relies on an older theme, plugins, and custom code. Start by inventorying those components and preparing a staging copy—do not switch PHP on the live site first. An update may affect a specific action, such as submitting a form, calculating shipping, or placing an order, without visibly changing the site.
Checking compatibility and testing the site are different tasks. Developer requirements and code analysis can reveal limitations, but only running your site’s actual workflows on the chosen PHP version shows how that particular installation behaves.
There is no single PHP version that is right for every site. Choose one based on the requirements of your installed WordPress version, theme, plugins, custom code, and hosting environment.
Inventory the site and choose a target version
Before making changes, put together a short list:
- The current PHP and WordPress versions, plus the WooCommerce version if the site uses it.
- The name and version of the active theme and whether a child theme is in use.
- The versions of major plugins, especially those for payments, shipping, forms, customer accounts, and integrations.
- Where custom code is stored: separate plugins, must-use plugins, theme files, or snippet managers.
- Any Composer-managed dependencies, including plugins or themes installed through Composer, and the locations of their
composer.json,composer.lock, andvendordirectories. - Required PHP extensions and important environment settings, such as the memory limit.
Some of this information is available under Tools → Site Health → Info in WordPress; the details shown depend on the WordPress version. Check the hosting control panel and component documentation for the rest. If you do not know where customizations are located, make finding them a separate task rather than assuming they do not exist.
Compare the target PHP version with the official requirements and release notes for the installed components. A minimum supported PHP version does not mean a component is compatible with every newer version. Check the PHP project’s current support schedule as well: availability in the hosting control panel alone does not make a release branch a suitable long-term choice.
If an older plugin version is incompatible, check whether a suitable update is available. An abandoned component may need to be replaced or modified. Missing compatibility information means the outcome is uncertain, not that the component has been proven to fail.
For Composer-managed code, ask the developer to review both the declared requirements and the locked dependency versions. Run composer check-platform-reqs against the installed dependencies using the target PHP interpreter. This checks PHP and extension requirements, not application behavior. Composer’s configured platform can differ from the actual runtime, so a successful dependency installation alone is not proof of compatibility. If dependencies need updating, resolve and test those changes separately on staging; do not run an unrestricted composer update on the live site.
Prepare a staging copy and verify recovery
A staging copy is a separate installation containing a copy of the site’s files and database. Before making changes, create a complete backup of the live site’s database and files, including uploads, custom code, and relevant configuration. Store it outside the installation being changed, with a protected copy off the affected server or in an independent backup service.
Verify that the backup can actually be restored. Perform a test restore in a separate, isolated environment and check that the files and database are usable. Document the steps, required access, and person responsible if the WordPress admin area becomes inaccessible. Retain the pre-change backup through testing and the post-update monitoring period, alongside the normal backup history; do not let the next scheduled backup overwrite your only recovery point.
Check the following conditions on staging:
- The environment closely matches production. Relevant settings, PHP extensions, and request handling should match. Otherwise, server differences rather than the PHP version may explain the results.
- The copy is isolated. Restrict access and anonymize real personal data where possible. Blocking search engine indexing alone does not protect that data.
- Tests have no real-world side effects. Redirect email to a test email service, use test mode for payment modules, and disable connections to the live CRM and other external systems or direct them to test environments.
- Background jobs are controlled. The scheduler and queues must not initiate real charges, send email campaigns, or synchronize live data from the copy. Run jobs needed for testing in a controlled way.
If an integration has no test environment, you cannot consider it fully tested on an isolated copy. Agree on a safe way to check it with a developer in advance, including what must be monitored after the live switch.
Verify the web and command-line PHP environments
The PHP version serving web requests may differ from the one used by scheduled jobs, WP-CLI, or deployment tools. They can also load different php.ini files and extensions. Check both environments on staging and repeat the check after deployment.
- Web requests: use Site Health and the host’s PHP diagnostics to confirm the active version and settings. If more detail is needed, a developer can inspect
phpinfo()output through a temporary, access-restricted diagnostic page. It exposes sensitive configuration details, so do not publish it openly and remove it immediately afterward. - Command-line processes: check
php -v,php --ini, andphp -mfor the actual interpreter used by each job. The shell’s defaultphpmay not be the binary configured in a scheduled task or deployment script. - Extensions: compare the loaded extensions and relevant versions with component requirements. Depending on the site, these may include
mysqli,mbstring,intl,curl,zip, XML-related extensions,gdorimagick, andopenssl. This is not a universal requirement list. JSON support is built into PHP 8 and later.
Use the hosting control panel or ask the host to confirm settings you cannot inspect yourself. After switching PHP or changing extensions, confirm whether the host automatically reloads or restarts the relevant PHP service. Where necessary, have the host or server administrator restart or reload PHP-FPM or the applicable Apache PHP service and reset OPcache in the affected web environment. A command-line cache reset does not clear PHP-FPM’s opcode cache. Do not assume restarting Nginx alone changes the PHP runtime.
Separate the PHP switch from other changes
First, run the main workflows on the staging copy with the original PHP version. This is your baseline: if a form already fails to send, its failure after the switch does not by itself prove a compatibility problem.
Then switch only PHP and repeat the same actions. If the transition requires updates to WordPress, the theme, plugins, or Composer dependencies, perform those as separate stages when dependencies allow, and record the results. Changing everything at once makes the cause of a failure harder to find.
A compatibility scanner can flag outdated code constructs, but it cannot replace this testing. It may miss an error that occurs only with certain data or a particular response from an external service. Conversely, a flagged issue does not always mean a feature will fail.
Test user workflows, not just pages
List the actions your business depends on. For each one, record the input, expected result, and actual result. A home page that opens confirms only that the home page opened.
- Inquiry form: submit valid data and data containing an error. Check the message shown to the user, whether the inquiry is saved if the site supports this, and whether it reaches the test email service or CRM. A success message alone does not confirm delivery.
- Cart and checkout: add a simple product and a variable product, if the store has them. Change the quantity, apply a coupon, select shipping, and place a test order. Check the contents and totals and confirm that the order appears in the WordPress admin area.
- Payment: use the provider’s test mode. Check the transaction result at the provider separately from the store’s receipt of confirmation, including any webhook notification. Confirmation may be delayed, and the appropriate order status depends on the payment method and order contents.
- Integration callbacks: test inbound webhooks and asynchronous callbacks for all relevant integrations, not just payments. Confirm that the external test service can reach the staging endpoint through any access restrictions, that authentication or signature validation succeeds, and that the expected record or status is updated. Where supported, check retries and duplicate delivery without triggering live actions.
- Customer account: test login, password recovery through the test email service, and order history or access to restricted content, depending on the site’s features.
- Admin work: save a post or product, upload an image, and run an important export or another regular operation.
- Background processes: check the result of required synchronization, queue processing, and scheduled jobs. These can fail without visibly affecting pages.
For each failure, record the time, page address, and sequence of actions. If a feature works on the original PHP version and fails on the target version with everything else held equal, that is a strong indication of an environment-related dependency, but the specific cause still needs investigation.
For repeatability, a developer can automate a small set of smoke tests: checks that public pages return expected content, critical endpoints respond correctly, and essential workflows complete in the test environment. Read-only WP-CLI checks can supplement these tests, but they exercise command-line PHP, not the web runtime. Keep checkout and other state-changing tests on staging unless a safe live procedure has been explicitly agreed.
Compare failures with error logs
After switching PHP, repeat the problematic action and review the PHP log on the hosting server. A developer can also enable WordPress diagnostic logging if needed. Logging errors and displaying them to visitors are separate settings: technical messages should not be displayed publicly on the live site. Protect diagnostic logs from public access as well.
- A fatal error stops the request from completing. The time, file, and call stack can help locate the problem, but the file mentioned is not always the root cause.
- A warning does not necessarily stop the site, but it may accompany a broken feature. If it appears in the server response, it can interfere with how a browser or integration processes the data.
- A deprecation notice does not by itself mean a feature has failed on the PHP version being tested. Evaluate it and plan a fix rather than hiding it and declaring compatibility confirmed. Deprecated functionality may be removed in a later release.
An empty log does not prove there are no errors: logging may be disabled or directed elsewhere. If a feature is not working, also check the request response, integration logs, and the status of the external service.
After a fix, repeat the original workflow and related actions. Give the developer an anonymized log excerpt and reproduction steps through an appropriate secure channel. Do not share passwords, tokens, customer data, or payment details openly.
Set conditions for the live switch and rollback
Moving the change to the live site is reasonable once critical workflows have been tested, there are no unexplained failures, and any remaining limitations are documented. If checkout or inquiry delivery has not been tested, there is not yet enough evidence to justify the switch.
Before switching, agree on the following:
- What will change. Typically, tested fixes are applied to the live site and the PHP version is changed. Do not overwrite the live database with the staging database: doing so can erase new orders, inquiries, and content changes. Take a fresh recovery backup before deployment.
- When the work will happen. Choose a lower-activity period and ensure access to the hosting control panel. Confirm the PHP versions and settings for web requests, scheduled jobs, and command-line processes, along with any required service reloads.
- How the result will be checked. Repeat key actions that can safely be performed on the live site, review logs, and check that the next important background jobs complete. Refresh relevant page and application caches so you are not evaluating only cached responses. Reuse the safe smoke tests prepared on staging.
- What will trigger a rollback. Examples include an unavailable site, inability to place an order, or confirmed failure of a critical integration. Assign someone responsible and confirm that the previous PHP version remains available from the host.
Switching PHP back does not undo file updates or database structure changes. The rollback procedure therefore depends on the full set of changes, not just the PHP version. Restoring an old database on a live store can erase orders received after the backup was created; that step requires a separate plan for preserving new data.
If the previous PHP branch no longer receives security updates, returning to it is a temporary measure to restore service, not the end of the task. After a rollback, fix the incompatibility and repeat the checks.
Monitor the first 24–72 hours
A successful immediate check does not cover delayed callbacks or jobs that run overnight. Assign someone to monitor the site during the first 24–72 hours and through the next run of any less frequent critical jobs:
- Review PHP, web server, WooCommerce, and integration logs for new or recurring errors.
- Compare orders, payment confirmations, and inquiry delivery with expected activity. Counts alone do not prove a PHP problem, but unexplained discrepancies need investigation.
- Check failed or overdue scheduled actions, queue backlogs, and completed synchronization jobs.
- Review payment gateway alerts, failed webhook deliveries, and callback retries.
- Repeat safe checks of important uncached workflows and record any customer-reported failures.
What to prepare for a diagnosis
I can check WordPress and custom PHP code for compatibility, locate errors, and assess the changes needed before the switch. Prepare the PHP, WordPress, theme, and major plugin versions, information about custom code and Composer dependencies, and a list of critical features. From there, we can define the staging checks and a controlled deployment and rollback procedure.
