Hi,
I recently moved my app from development(WAMP) to production environmnent(LEMP). I am facing some configration issues. In my app, i have set phalcon to autoload external libraries. It is working fine in WAMP, but not in LEMP. I have this class not found Error
The external library i am using is Sendgrid Api.
This is how i set phalcon to autoload the libraries.
1) Config.php Add the libraryDir path
return new \Phalcon\Config(array(
'application' => array(
'controllersDir' => __DIR__ . '/../../app/controllers/',
'modelsDir' => __DIR__ . '/../../app/models/',
'viewsDir' => __DIR__ . '/../../app/views/',
'pluginsDir' => __DIR__ . '/../../app/plugins/',
'libraryDir' => __DIR__ . '/../../app/library/',
'cacheDir' => __DIR__ . '/../../app/cache/',
'baseUri' => '/',
),
));
2) Loader.php - Register the directories
$loader->registerDirs(
array(
$config->application->controllersDir,
$config->application->modelsDir,
$config->application->libraryDir
)
);
3) Calling it in the controllers
function sendEmail($emailaddress,$name,$message,$toemail){
try{
$sendgrid = new SendGrid($this->config->sendgrid->username, $this->config->sendgrid->password,$this->config->sendgrid->options);
$email = new SendGrid\Email();
...
}
}
My library folder resides in app folder.
Any help appreciated! The weird thing is that i do not know why it is working fine in WAMp but not in LEMP