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

Custom Class not working on server

I am using phalcon in one of the my project and i'm using some custom classes for whole application its just like a plugin the issue is the project is working on our local and stagging server but when I upload this to client server i gout class not found error I have registered the classes into loader but that is not working only client servers ther we have installed the phalcon successfully but getting error into error logs.

Please help me for this issue.

$config = $this->getConfig()->toArray();

    $di = new \Phalcon\DI\FactoryDefault();

    $loader = new \Phalcon\Loader();

    /**
     * We're a registering a set of directories taken from the configuration file
     */
    $loader->registerDirs($config['services'])->register();
    foreach($config['services'] as $key => $value) {
        $loader->registerNamespaces(array(
            $key => $value
        ));
    }

i got this when print the loader

***Phalcon\Loader Object ( [_eventsManager:protected] => [_foundPath:protected] => [_checkedPath:protected] => [_prefixes:protected] => [_classes:protected] => [_extensions:protected] => Array ( [0] => php ) [_namespaces:protected] => Array ( [Models] => application/models/ ) [_directories:protected] => Array ( [Library] =>/application/library/ [Models] =>./application/models/ ) [_registered:protected] => 1 )

my custome functions under the ../application/library/standered/functions

the error into the log file is : PHP Fatal error: Class 'Standard\Functions' not found in /application/application.php on line 185



43.9k
Accepted
answer

Hi,

maybe just a typo error:

my custome functions under the ../application/library/standered/functions

Class 'Standard\Functions' not found

rename your "standered" directory to "standard"



893
edited Mar '15

Thanks for reply , yes the issue with case sensitive we witer Standred and the folder name was standred.

Hi,

maybe just a typo error:

my custome functions under the ../application/library/standered/functions

Class 'Standard\Functions' not found

rename your "standered" directory to "standard"