How to fix Undefined class constant ‘ARRAY_AS_PROPS’ Fatal Error?

I received this error “Fatal Error: Uncaught error in Undefined class constant ‘ARRAY_AS_PROPS’”
This issue is not related to PHP if you have 7.0 and above, it is zend framework’s module zend-http wrapper which is affected if Apache module is not present

File responsible: zendframework\zend-http\src\Header\Cookie.php:75

public function __construct(array $array = [])
{
        parent::__construct($array, ArrayObject::ARRAY_AS_PROPS);
}

Solution

Do check enabled modules for Apache, I found out that mod_expires was not enabled. So I edited httpd.conf and enabled mod_expires

I also enabled Zend Opcache in php.ini to make it run smooth on multiple pageloads.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *