Abdul Waheed Abdul Waheed - 1 year ago 119
PHP Question

Phalcon framework setting up project to local xampp from bit bucket

hi i have cloned the project files and i have installed phalcon framework in xampp with version. i can see in php info as phalcon installed.

when i browse the project i overcome with this issue how can i resolve it.

Fatal error: Declaration of
Phalcon\Acl\Adapter\Database::allow($roleName, $resourceName, $access)
must be compatible with Phalcon\Acl\AdapterInterface::allow($roleName,
$resourceName, $access, $func = NULL) in
on line 33

This my database.php code:

namespace Phalcon\Acl\Adapter;

use Phalcon\Db;
use Phalcon\Acl\Adapter;
use Phalcon\Acl\AdapterInterface;
use Phalcon\Acl\Exception;
use Phalcon\Acl\Resource;
use Phalcon\Acl;
use Phalcon\Acl\Role;
class Database extends Adapter implements AdapterInterface //this is line 33
protected $options;

Answer Source

Your code in database.php is from Phalcon v2. And you are working with Phalcon v3 on your XAMPP setup.
v2 and v3 have lots of API changes and the errors your are getting are because of this.

You have 2 options here.

  1. Lots of work: Upgrade all of your code to make it Phalcon v3 compatible. And upgrade your Phalcon version on your production environment to Phalcon v3.

  2. Easier fix: Downgrade your Phalcon version on your XAMPP to Phalcon v2.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download