PHP errors: understand them and fix them step by step
Find the message you see on your screen or in your log.
Which PHP version does your site report?
We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.
More about this
Each guide explains what it means, what usually causes it and what you can safely try yourself.
Error guides
Pick the guide that matches your message. Not sure which one it is? Start with the overview of common PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. errors.
- WordPress 508 Resource Limit: Causes and Next StepsA 508 Resource Limit Is Reached message can stop your WordPressWordPress is free software for building and editing a website in your browser. It is written in PHP, so it builds each page when someone visits. site. Find the hostingWeb hosting is the service that keeps your website's files on a computer that is always online, so visitors can open your site at any time. limit involved, check the cause and plan a lasting fix.
- Argument must be of type after a PHP upgradeArgument must be of type after an upgrade? Identify the rejected argument, trace its source and test validation that preserves the meaning of the input.
- Fix array_key_exists receiving an object in PHPArray_key_exists expects an array but receives an object? Check the data source and distinguish missing keys, empty values and object properties.
- Trying to access array offset on null in WordPressArray offset on null after a PHP upgrade? Trace the missing collection and test empty results separately from failed lookups with five repair steps.
- __autoload() no longer supported after a PHP update__autoload() is no longer supported? Locate the legacy class loader and test its replacement alongside the loaders your application already uses.
- Fix Cannot assign to property of type in PHPCannot assign to property of type in PHP? Trace the rejected value and repair input handling for a typed property without losing saved information.
- Cannot redeclare after a PHP upgradeCannot redeclare after a PHP upgrade? Compare both definitions, investigate duplicate snippets or files and test which code your website needs.
- Class not found after a PHP upgradeClass not found after a PHP upgrade? Check missing files, autoloading and package versions before replacing code or libraries in a live installation.
- Composer memory exhausted after a PHP upgradeComposerComposer is a tool that downloads the code libraries a PHP project needs and notes exactly which versions, so the project can be rebuilt the same way anywhere. stops with Allowed memory size after a PHP upgrade? Check the terminal PHP versionA PHP version is a numbered edition of PHP, like 8.3. Each edition is looked after for a limited time, then gets security fixes only, then nothing., its memory limit and the exact installation step that fails.
- count() TypeError after a PHP 8 upgradecount(): argument must be Countable or array after PHP 8? Trace the unexpected input and repair the data flow without silently counting failures as zero.
- create_function() missing after PHP upgradecreate_function() missing after PHP upgrade? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- WordPress: There Has Been a Critical Error on This WebsiteSeeing 'There has been a critical error on this website'? Find the cause, use recovery modeWordPress recovery mode is a safe mode that starts after a serious error, so you can still log in and switch off the plugin or theme that broke your site. and fix the error step by step.
- ctype_digit(): non-string argument is deprecatedctype_digit() warns about non-string input? Identify the intended character or number and test validation before applying a type conversion.
- cURL SSL certificate problem after a PHP upgradecURLcURL is a tool that lets software, such as PHP, fetch information from other websites and services, for example to check for updates or send an order. or OpenSSL reports a certificate error after a PHP upgrade? Check configuration and certificate trust without turning off connection verification.
- Curly braces offset error after a PHP upgradeCurly braces offset error after a PHP upgrade? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- WordPress Database Connection Error: What to CheckWordPress cannot connect to its database? Check the connection settings, hosting status and PHP extensions safely before changing or restoring anything.
- Declaration must be compatible: fix the PHP errorDeclaration must be compatible after a PHP update? Compare pluginA WordPress plugin is an add-on you install in WordPress to give your site extra features, such as contact forms, SEO tools or a webshop. and parent method signatures and test a supported combination of components.
- PHP Deprecated Warnings in PHP 8.x: What They MeanPHP deprecatedA deprecation is an early warning that a feature still works today but will be removed in a future PHP version, so code using it must be changed in time. warnings after an upgrade to PHP 8.x: what they mean, which ones matter and how to fix the code.
- How to Show PHP Errors and Read the Error LogShow PHP errors and read the error logAn error log is a file where your website's software writes down what went wrong, with the time and place. It is the first thing to check when a site breaks.: where the log lives, what to look for and how to switch display off again safely.
- DivisionByZeroError: PHP calculation failsDivisionByZeroError after a PHP update? Trace the zero divisor and test empty data without returning an invented result as a successful calculation.
- Using ${var} in strings is deprecated in PHPUsing ${var} in strings is deprecated? Review variables in text templates and preserve the intended output when updating interpolation syntax.
- Dynamic property deprecated in PHP 8.2: fix the causeCreation of dynamic property appears from PHP 8.2. Find the affected plugin or class and plan a compatible fix instead of simply hiding the warning.
- Call to undefined function each() after PHP upgradeCall to undefined function each() after PHP upgrade? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- PHP Fatal Error: What It Means and How to Fix ItA PHP fatal error stops your site mid-load. Read the message, find the file and line, and take a safe first step to fix it.
- fgetcsv(): missing explicit escape after a PHP updatefgetcsv() warns that escape must be explicit? Review the CSV format and test quoted fields before changing the settings used by your importer.
- foreach() argument must be of type array|objectforeach() received neither an array nor an object? Trace the supplied value and separately test several items, zero items and failed processing.
- Headers already sent after a PHP upgradeCannot modify headerAn HTTP header is a short line of extra information that a browser and a website send each other with every page request, invisible to the visitor. information after a PHP upgrade? Find the first output, check earlier warnings and repair redirects or sessions step by step.
- HTTP 500 Internal Server Error in PHP: How to Fix ItAn HTTP 500An HTTP status code is a three-digit number a website sends back with every page request to say how it went, such as 200 for OK or 500 for an error. error on a PHP site hides the real cause. Check the error log, .htaccess and plugins to find it.
- Implicitly nullable parameter warning in PHPImplicitly marking parameter as nullable is deprecated? Declare null explicitly while preserving the intended behaviour of optional input.
- implode(): argument order error after PHP upgradeimplode(): argument order error after PHP upgrade? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- Fix must be a valid callback after a PHP updateMust be a valid callback after a PHP update? Check the registered function, loading order and method used by your WordPress extension or custom code.
- WordPress Stuck in Maintenance Mode: Safe RecoveryWordPress still says it is unavailable for scheduled maintenance? Check whether an update stopped, remove the leftover file safely and finish the update.
- Maximum execution time after a PHP upgradeMaximum execution time exceeded after a PHP upgrade? Identify the interrupted task, measure execution and inspect partial results before retrying.
- Call to a member function on null in WordPressCall to a member function on null in WordPress? Find the missing object, choose appropriate handling and verify the visitor journey in five steps.
- Allowed Memory Size Exhausted in PHP: How to Fix ItAllowed memory size exhausted means PHP ran out of memory. See what causes it and how to raise memory_limitmemory_limit is a PHP setting that decides how much memory the code behind one page may use. If it needs more, it stops with an error. safely.
- mysql_connect() missing after a PHP upgrademysql_connect() missing after a PHP upgrade? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- Fix mysqli_sql_exception after a PHP updateUncaught mysqli_sql_exception after PHP 8.1? Investigate the database failure and exception handling without hiding errors or overwriting stored data.
- Non-static method cannot be called statically: fixNon-static method cannot be called statically: fix? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- Passing null to parameter of type string is deprecatedPassing null to parameter of type string? Identify the parameter, distinguish null from empty text and repair how missing input is handled.
- Common PHP Errors: What They Mean and Where to StartCommon PHP errors in one place: what the message means, likely causes and where to start fixing it.
- PHP Notice and Warning Messages ExplainedPHP notices and warnings explained: what they mean, when they matter and how to fix them without hiding them.
- WordPress Plugin Conflict After a PHP UpdateA plugin breaks your WordPress site after a PHP update. Find the conflicting plugin and get the site working again.
- Fix positional argument after named argument in PHPCannot use positional argument after named argument? Fix PHP argument order and verify that each supplied value still reaches the intended parameter.
- Attempt to read property on null in WordPressAttempt to read property on null? Trace the absent object, distinguish empty fields and check that displayed labels and subsequent actions stay correct.
- Required parameter follows optional after a PHP upgradeRequired parameter follows optional? Review the function contract and its callers before removing defaults or moving parameters after a PHP upgrade.
- Uncaught TypeError: return value after a PHP upgradeUncaught TypeError with Return value must be of type? Trace the function output and test successful, empty and failed results separately.
- Serializable is deprecated: stored PHP objectsSerializable deprecation after a PHP update? Review storage methods and test existing data before changing how application objects are serialized.
- Website Down After a PHP Update: What to Check FirstYour website went down after a PHP update? Check what changed, find the error and roll back or fix it without guessing.
- Return type should be compatible: PHP 8.1 noticeReturn type should either be compatible in PHP? Check an internal interface implementation and verify the values returned along every relevant path.
- WordPress Theme Breaks on PHP 8: What to DoYour WordPress themeA WordPress theme is a ready-made package that decides how your WordPress site looks and how its pages are laid out. Change the theme and the design changes. breaks on PHP 8. See which code fails, how to check compatibility and what to do next.
- ArgumentCountError: Too few arguments in WordPressToo few arguments in WordPress? Compare the caller with the function, trace missing input and test each affected route with five repair steps.
- Typed property must not be accessed before initializationTyped property not initialized? Check object creation, assignment and first access, then test both new objects and objects built from stored data.
- Uncaught ValueError after a PHP upgradeUncaught ValueError after a PHP upgrade? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- Undefined array key after a PHP upgradeUndefined array key after a PHP upgrade? Trace the missing field, distinguish absent from empty values and test normal and incomplete input.
- Uncaught Error: Undefined constant after PHP upgradeUncaught Error: Undefined constant after PHP upgrade? Trace the cause with five repair steps, focused checks and sources from the PHP manual.
- Undefined function after a PHP upgradeSeeing Call to undefined function after a PHP upgrade? Check missing extensions, removed functions and outdated plugin code before changing your site.
- Warning: Undefined variable in WordPressUndefined variable after a PHP upgrade? Trace assignments, check scope and conditions, and test the affected page with and without input.
- Unknown named parameter after a PHP updateUnknown named parameter in PHP? Check parameter names and associative argument arrays before changing the way a plugin calls another function.
- Unparenthesized ternary error after updating PHPUnparenthesized ternary is not supported? Establish the intended decision order and test every outcome before changing parentheses in old code.
- Unsupported operand types after a PHP upgradeUnsupported operand types after a PHP upgrade? Inspect the values used in the calculation and test amounts, empty input and invalid data separately.
- PHP White Screen of Death: Causes and FixesA blank white page on your PHP or WordPress site? Find out what causes the white screen of death and how to bring your site back.
- WooCommerce Allowed memory size after a PHP upgradeWooCommerceWooCommerce is a free add-on for WordPress that turns your website into a webshop, with products, a shopping cart and a checkout. Allowed memory size after an upgrade? Measure the affected store action, check the active limit and test orders and imports carefully.
- WordPress Outage: Find the Cause and Recover SafelyA blank screen, error or unavailable WordPress site? Check hosting, recent changes and logs, then choose the next step without adding another unknown.
- WordPress: PHP does not meet minimum requirementsWordPress or a plugin rejects your PHP version? Compare the actual server version with that component’s requirement and prepare a tested upgrade.
Where to start
Every guide follows the same order, because it keeps you from making things worse. First you make a backupA backup is a separate copy of your website's files and database, so you can bring the site back after a mistake, a hack or a failed update. of the files and the database, so every step can be undone. Then you read the error log instead of showing errors on the live site, since on-screen messages can reveal details about your server.
Next you note the error type, the file and the line, and check which PHP version the site runs.
Many errors start right after an update of PHP, a plugin or a theme. In that case the lasting fix is updating or replacing the old code, and running a PHP version that still receives security fixes.
Share this page
Ask your AI to explain
Opens the chat with a question about this page. An AI answer can differ; the sources above are leading.
This question is sent along: Summarise the confirmed facts on https://websitewithoutphp.com/en-gb/php-errors/ in 5 short points, with the source per point.
- Domain
- Check
- Result
- Report
We are checking
We only read what your site already sends in public. This takes a few seconds.
- Looking up the domain
- Connecting to your site
- Reading the headers
- Identifying the platform
- Identifying the CDN or firewall
Adds platform, firewall or CDN, hosting and your previous scan. We add your result to the form. A person replies within 1 working day.
Details
- Website
- PHP
- PHP version
- Checked
Headers we looked at
What this does not tell you
Read how to find your PHP version yourself
Ask your hosting provider
Copy this question and send it to your hosting provider or developer. You do not need to give us an email address for this.
Which PHP version does this website use, and how do I check that in my hosting panel?
Where should we send your report?
You see the report below. The email version, ready to forward to your web developer, follows.
Your full report
- Website
- PHP
- PHP version
- Platform
- Firewall/CDN
- Hosting
- Previous scan
We add your result to the form. A person replies within 1 working day.