PHP Error Library

Practical PHP error explanations with causes, diagnosis steps, and modern fixes.

Paste your PHP error

Paste a fatal, warning, SQLSTATE, or cURL message. Paths and line numbers are normalized and are not stored.

Open full Error Matcher

PHP errors are often more actionable than they look—if you know which fragment of the message matters. This library focuses on real diagnostic workflows: isolate the message, identify the subsystem, reproduce with the smallest input, then apply a fix that survives PHP upgrades.

Paste a full fatal/warning into the matcher, browse categories such as Composer, Xdebug, PHP-FPM, Apache, nginx, and database/SQLSTATE issues, or filter by PHP version and environment. Every guide starts near the answer—no generic “PHP is popular” filler.

Cross-link into the PHP Error Matcher, Configuration Inspector, and Composer Platform Checker when text analysis helps more than another prose page.

Browse by category

Syntax & Parse

8 guides

Parser and tokenization failures.

Variables & Constants

4 guides

Variable scope and constant lookup.

Arrays

7 guides

Array keys, offsets, and shapes.

Strings

2 guides

String operations and encoding.

Functions

7 guides

Function declarations and calls.

Classes & Objects

9 guides

Object model and property failures.

Namespaces & Autoload

4 guides

Name resolution and loading.

Type Errors

10 guides

Runtime type contract violations.

Exceptions

4 guides

Thrown and uncaught exceptions.

Warnings & Notices

9 guides

Non-fatal runtime diagnostics.

Deprecated

2 guides

Version migration deprecations.

Filesystem

3 guides

File paths, permissions, and streams.

Uploads

3 guides

HTTP upload handling.

Sessions & Cookies

7 guides

Session persistence and cookies.

Headers & Output

4 guides

HTTP output ordering.

JSON

4 guides

JSON parsing and encoding.

Date & Time

2 guides

Timezone and date processing.

Memory & Performance

4 guides

Resource and execution limits.

Composer

17 guides

Dependency and autoload tooling.

PDO

4 guides

PDO drivers and statements.

MySQL & MariaDB

10 guides

Database server errors.

Database Connections

4 guides

Connection and authentication.

cURL & HTTP

3 guides

Outbound HTTP transfers.

SSL Certificates

1 guides

TLS trust and certificates.

PHP Extensions

3 guides

Extension loading and availability.

PHP-FPM

8 guides

FastCGI process management.

Apache

4 guides

Apache PHP integration.

nginx

4 guides

nginx FastCGI integration.

Xdebug

9 guides

Xdebug diagnostics.

OPcache

3 guides

Bytecode cache configuration.

CLI

5 guides

Command-line PHP.

Cron

3 guides

Scheduled PHP tasks.

WordPress PHP

2 guides

WordPress runtime integration.

Laravel PHP

2 guides

Laravel container and runtime.

Symfony PHP

1 guides

Symfony services and runtime.

Zend & Laminas

2 guides

Zend Studio and Laminas runtime.

Legacy PHP

6 guides

Removed and historical behavior.

PHP Version Compatibility

3 guides

Cross-version migration failures.

php.ini

9 guides

PHP configuration directives.

Filter the library

162 matching guides

Title Pattern Severity
502 Bad Gateway from PHP-FPM 502 Bad Gateway error
Allowed memory size exhausted Fatal error: Allowed memory size of %d bytes exhausted (tried to allocate %d bytes) in %s on line %d fatal
Apache AH01071 Primary script unknown AH01071: Got error 'Primary script unknown' error
Apache Invalid command php_value AH00526: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration error
Apache premature end of script headers Premature end of script headers: index.php error
Apache proxy_fcgi timeout AH01079: failed to make connection to backend: %s error
Application requires a newer PHP runtime This application requires PHP %s or newer. You are running %s. fatal
Argument must be of type Fatal error: Uncaught TypeError: save(): Argument #1 ($id) must be of type int, string given in %s on line %d fatal
Array to string conversion Warning: Array to string conversion in %s on line %d warning
Attempt to read property on null Warning: Attempt to read property "email" on null in %s on line %d warning
Call to a member function on null Fatal error: Uncaught Error: Call to a member function %s() on null in %s:%d fatal
Call to undefined function Fatal error: Uncaught Error: Call to undefined function %s() in %s:%d fatal
Call to undefined function create_function Fatal error: Uncaught Error: Call to undefined function create_function() in %s on line %d fatal
Call to undefined function each Fatal error: Uncaught Error: Call to undefined function each() in %s on line %d fatal
Call to undefined function mysql_connect Fatal error: Uncaught Error: Call to undefined function mysql_connect() in %s on line %d fatal
Cannot access offset of type string on string Fatal error: Uncaught TypeError: Cannot access offset of type string on string in %s on line %d fatal
Cannot declare class because the name is already in use Fatal error: Cannot declare class App\\Model\\User, because the name is already in use in %s on line %d fatal
Cannot modify header information — headers already sent Warning: Cannot modify header information - headers already sent by (output started at %s:%d) in %s on line %d warning
Cannot modify readonly property Fatal error: Uncaught Error: Cannot modify readonly property Invoice::$id in %s on line %d fatal
Cannot redeclare class Fatal error: Cannot redeclare class CacheStore in %s on line %d fatal
Cannot redeclare function Fatal error: Cannot redeclare %s() (previously declared in %s:%d) in %s on line %d fatal
Cannot send session cache limiter or cookie Warning: session_start(): Cannot send session %s - headers already sent warning
Cannot use object as array Fatal error: Uncaught Error: Cannot use object of type stdClass as array in %s on line %d fatal
Class not found Fatal error: Uncaught Error: Class "%s" not found in %s:%d fatal
Class not found after Composer install Class "%s" not found error
Composer abandoned package warning Package old/vendor is abandoned, you should avoid using it. Use new/vendor instead. warning
Composer allow-plugins blocked plugin acme/installer contains a Composer plugin which is blocked by your allow-plugins config. error
Composer dist download failed Failed to download acme/package from dist: The zip extension and unzip/7z commands are both missing, skipping. warning
Composer GitHub API rate limit exceeded Could not fetch https://api.github.com/repos/acme/package, please create a GitHub OAuth token to go over the API rate limit error
Composer invalid composer.json "./composer.json" does not contain valid JSON: Parse error on line 8 error
Composer lock file is not up to date The lock file is not up to date with the latest changes in composer.json. warning
Composer memory limit exhausted PHP Fatal error: Allowed memory size exhausted while running Composer fatal
Composer minimum stability conflict Could not find a version of package acme/dev-tool matching your minimum-stability (stable). error
Composer package could not be found Could not find a matching version of package acme/report. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability. error
Composer platform requirements not satisfied Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.29. error
Composer plugin API version mismatch Plugin acme/installer requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.6.0"). error
Composer process timeout exceeded The process exceeded the timeout of 300 seconds. error
Composer repository authentication required Invalid credentials for https://repo.%s/packages.json, aborting. error
Composer requirements could not be resolved Your requirements could not be resolved to an installable set of packages. error
Constant already defined Warning: Constant APP_ENV already defined in %s on line %d warning
Creation of dynamic property is deprecated Deprecated: Creation of dynamic property App\\Entity\\Order::$total is deprecated in %s on line %d notice
Cron PHP environment variables are missing RuntimeException: Required environment variable %s is not set error
Cron PHP mail or PATH command fails sh: 1: %s: not found warning
Cron uses the wrong PHP path /bin/sh: %s: No such file or directory error
cURL error 28 operation timed out cURL error 28: Operation timed out after 10001 milliseconds error
cURL error 6 could not resolve host cURL error 6: Could not resolve host: %s error
cURL error 60 SSL certificate problem cURL error 60: SSL certificate problem: unable to get local issuer certificate error
cURL error 7 failed to connect cURL error 7: Failed to connect to %s port 443: Connection refused error
DateTime failed to parse time string Exception: Failed to parse time string (%s) at position %d error
Deprecated dynamic property Deprecated: Creation of dynamic property User::$role is deprecated in %s on line %d notice

FAQ

How should I search for a PHP error?

Paste the distinctive message fragment or the full fatal/warning line. Dynamic paths and line numbers are normalized automatically.

Are these pages replacements for the PHP manual?

No. They are practical troubleshooting guides that complement php.net, Composer, Xdebug, and server documentation.