Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

securityPlugin problem on ubuntu

Hi Guys i used invo securityplugin in my project and it works fine when i run it on xampp but after uploading code on linux ubuntu i get this error

Fatal error: Uncaught Error: Class 'SecurityPlugin' not found in /var/www/html/master/app/config/services.php:24 Stack trace: #0 [internal function]: Closure->{closure}() #1 [internal function]: Phalcon\Di\Service->resolve(NULL, Object(Phalcon\Di\FactoryDefault)) #2 [internal function]: Phalcon\Di->get('dispatcher', NULL) #3 [internal function]: Phalcon\Di->getShared('dispatcher') #4 /var/www/html/master/public/index.php(42): Phalcon\Mvc\Application->handle() #5 {main} thrown in /var/www/html/master/app/config/services.php on line 24

and it's not permision problem, projects witout securityplugin work fine

all folder and files are 777



use Phalcon\Mvc\View;
use Phalcon\Mvc\View\Engine\Php as PhpEngine;
use Phalcon\Mvc\Url as UrlResolver;
use Phalcon\Mvc\View\Engine\Volt as VoltEngine;
use Phalcon\Mvc\Model\Metadata\Memory as MetaDataAdapter;
use Phalcon\Session\Adapter\Files as SessionAdapter;
use Phalcon\Flash\Direct as Flash;
use Phalcon\Mvc\Dispatcher;
use Phalcon\Events\Manager as EventManager;
 * Assign Plugins To Dispatcher
$di->setShared('config', function () {
    return include APP_PATH . "/config/config.php";
    function () {
        $eventManager = new EventManager();
            new SecurityPlugin()
        $dispatcher = new Dispatcher();
        return $dispatcher;

 * Shared configuration service
$di->setShared('config', function () {
    return include APP_PATH . "/config/config.php";




$loader = new \Phalcon\Loader();

 * We're a registering a set of directories taken from the configuration file



defined('BASE_PATH') || define('BASE_PATH', getenv('BASE_PATH') ?: realpath(dirname(__FILE__) . '/../..'));
defined('APP_PATH') || define('APP_PATH', BASE_PATH . '/app');

return new \Phalcon\Config([
    'database' => [
        'adapter'     => 'Mysql',
        'host'        => 'localhost',
        'username'    => 'root',
        'password'    => '',
        'dbname'      => 'master',
        'charset'     => 'utf8',
    'application' => [
        'appDir'         => APP_PATH . '/',
        'controllersDir' => APP_PATH . '/controllers/',
        'modelsDir'      => APP_PATH . '/models/',
        'migrationsDir'  => APP_PATH . '/migrations/',
        'viewsDir'       => APP_PATH . '/views/',
        'pluginsDir'     => APP_PATH . '/plugins/',
        'libraryDir'     => APP_PATH . '/library/',
        'cacheDir'       => BASE_PATH . '/cache/',
        'baseUri'        => preg_replace('/public([\/\\\\])index.php$/', '', $_SERVER["PHP_SELF"]),


Hi @MohammadRz check please if your SecurityPlugin class is in SecurityPlugin.php file be careful with uppercases. Is very common miss some uppercase in windows and then in linux don't find the file because linux is case sensitive.

Other posible problem your namespaces, check if SecurityPlugin have one or not.

Docs loader and namespaces

Good luck

Thank you!! SecurityPlugin was all in lowercase