We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Can't extend a class in a CLI application

Hi, title is clear. I can't extend a class in my CLI application. All the following classes are in the lib folder :

class FraudTask extends \Phalcon\CLI\Task {

    public function mainAction() {

        $liveFraud = new LiveFraud();

        //$liveMobileFraud = new LiveMobileFraud();

class LiveFraud extends Fraud {

abstract class FraudĀ  {

In my config file :



    APPLICATION_PATH . '/tasks',
    APPLICATION_PATH . '/models',
    APPLICATION_PATH . '/lib',


When I execute : php cli.php fraud

Fatal error: Class 'Fraud' not found in /Library/WebServer/Documents/tuangocli/app/lib/LiveFraud.php on line 30

I don't understand why the class is not found.

edited May '14

It seems that the class is not loaded properly. Please try to put the class into a namespace and register the namespace.

Like this:

namespace Acme;

abstract class Fraud  {

'Acme' => '/path/to/lib'

Registering namespaces is more efficient then registering directories. You need to do this for the other classes as well.


Hi, it's funy because I got another post for the same problem, but with namespace. In other word, I already try with namespace and I got the same result.


Thank you !