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

Handler class cannot be loaded

I just started using Phalcon and went through this tutorial: your first encounter with Phalcon (https://blog.phalcon.io/post/36648855158/tutorial-your-first-encounter-with-phalcon-part-2)

I've done all the steps until Step 8 and when I go to localhost/blog/posts it will show this error: PostsController handler class cannot be loaded

The database is created in my phpmyadmin, and the models are created through the Phalcon command line already. I'm using Wampserver v2.4, Apache Version : 2.4.4, PHP Version : 5.4.12.

Can you help me through this problem? Thank you.



98.9k

Could you please post the app's code?

Identical situation as above... tutorial-your-first-encounter-with-phalcon-part-2 ... Step 8 (windows with wamp)

config.php return new \Phalcon\Config(array( 'database' => array( 'adapter' => 'Mysql', 'host' => 'localhost', 'username' => 'root', 'password' => '', 'dbname' => 'phalcon_blog2', ), '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' => '/', ) )); What other files do I need to post?

Update... It appears I am missing some file and folders in app/views yet I followed the instruction to the letter... I best start over and see if I can find where I went wrong...

Step 3 - Initial setup of our application... does not create all the folder as indicated by the graphic... For example in app/views it only creates the index and layouts folders and the index.volt file...

Apart from the missing folders (posts, users and categories) the index file should be .phtml?

I must assume this is where the problem lies but I will continue on just in case these are created later in the tutorial...

Added the missing directories and files manually (used the other phalcon blog tutorial @ git as reference), set up virtual host and we're up and running...