We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Cannot create controller via devtools but can create model

hello I am a beginner phalcon user, I have a problem creating a controller in my phalcon and can't find the answer .. can someone help me?

phalcon controller test

PHP Fatal error: Uncaught Error: Call to a member function path() on integer in /home/amianaaa/vendor/phalcon/devtools/scripts/Phalcon/Builder/Controller.php:74 Stack trace:

0 /home/amianaaa/vendor/phalcon/devtools/scripts/Phalcon/Commands/Builtin/Controller.php(74): Phalcon\Builder\Controller->build()

1 /home/amianaaa/vendor/phalcon/devtools/scripts/Phalcon/Script.php(117): Phalcon\Commands\Builtin\Controller->run(Array)

2 /home/amianaaa/vendor/phalcon/devtools/scripts/Phalcon/Script.php(151): Phalcon\Script->dispatch(Object(Phalcon\Commands\Builtin\Controller))

3 /home/amianaaa/vendor/phalcon/devtools/phalcon(76): Phalcon\Script->run()

4 {main}

thrown in /home/amianaaa/vendor/phalcon/devtools/scripts/Phalcon/Builder/Controller.php on line 74

I am using phalcon version 3.4.5 and devtools version 3.4.11


edited Aug '20

Hello !

i advice you to move to phalcon 4



does this happen when creating a model ?

edited Sep '20

i think you dont have the config file

try to create one


use Phalcon\Config;

$settings = array(
    "database" => array(
        "adapter" => "Mysql",
        "host" => "localhost",
        "username" => "root",
        "password" => "",
        "name" => "dbname",
return $config = new Config($settings);