Hi i have problem with ZF2,
when trying to access at public/index from the browser i got this Fatal Error from Server:
PHP Fatal error: Declaration of Zend\\Stdlib\\ArrayObject::offsetGet() must be compatible with that of ArrayAccess::offsetGet() in /var/www/somevirtualhost/vendor/zendframework/zendframework/library/Zend/Stdlib/ArrayObject.php on line 23
I already update the composer.json from:
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"homepage": "http://framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.3.*"
}
}
to:
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"homepage": "http://framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.*"
}
}
Also on init_autoloader.php i added this lines:
require $zf2Path . '/Zend/Stdlib/compatibility/autoload.php';
require $zf2Path . '/Zend/Session/compatibility/autoload.php';
and this how init_autoloader looks like:
if ($zf2Path) {
if (isset($loader)) {
$loader->add('Zend', $zf2Path);
$loader->add('ZendXml', $zf2Path);
} else {
include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
Zend\Loader\AutoloaderFactory::factory(array(
'Zend\Loader\StandardAutoloader' => array(
'autoregister_zf' => true
)
));
//Fix for PHP 5.3.3
require $zf2Path . '/Zend/Stdlib/compatibility/autoload.php';
require $zf2Path . '/Zend/Session/compatibility/autoload.php';
}
}
Besides all the changes mentioned above, i still receive the getting the same error. By the way this is my PHP Versión:
PHP 5.3.3-7+squeeze19 with Suhosin-Patch (cli) (built: Feb 18 2014 13:59:15)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH