PHP65 errors documented

Common PHP Errors and How to Fix Them

Browse all documented PHP errors with detailed explanations, root causes, and step-by-step fixes.

Trying to access array offset on value of type null in /var/www/html/data.php on

This error occurs when a developer tries to access an element of an array or object using a key or property, but the val

PHP
Guide

Attempt to assign property of non-object in /var/www/html/controllers/UserContro

This error occurs when you're trying to access a non-object property using object syntax. It could be due to a failed da

PHP
Guide

Cannot modify header information - headers already sent in /var/www/html/index.p

This error occurs when you're trying to send HTTP headers after output has already been sent to the browser. In PHP, hea

PHP
Guide

Notice: Undefined variable: database_connection in /var/www/html/database_operat

This error occurs when a variable has not been declared or initialized before it's being used in a script.

PHP
Guide

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate en

This error occurs when you attempt to insert a duplicate value into a column that has a unique constraint, such as a pri

PHP
Guide

Warning: Cannot redeclare class Foo in /var/www/html/autoloader.php on line 55

This error occurs when a PHP script attempts to declare a class with the same name in a different scope, usually due to

PHP
Guide

Unexpected '}' at end of file in /var/www/html/script.php on line 1

This error occurs when the PHP interpreter encounters unexpected syntax at the end of a file. In this case, it's a closi

PHP
Guide

Cannot pass parameter 2 by reference in /var/www/html/api.php on line 56

This error occurs when trying to pass a value by reference in a function parameter that has been declared to be passed b

PHP
Guide

The controller method 'render' is not defined in the controller 'App\Controllers

This error is thrown when a controller method is not found or is not defined in the controller class.

PHP
Guide

Undefined property: stdClass::$email in /var/www/html/user.php on line 56

This error occurs when a property or method is not defined in an object. It is often caused by typos or incorrect object

PHP
Guide

Undefined variable: product in /var/www/html/cart.php on line 27

This error occurs when a variable is used before it is declared or assigned a value.

PHP
Guide

Fatal error: Uncaught Error: Cannot pass string to argument 1 of fgets(), expect

This error occurs when a PHP function that expects a resource (like a file pointer) is passed a string instead.

PHP
Guide

Have a PHP error that's not listed? Get an instant explanation.

Explain Another Error