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

Class Not Found

Hey guys, I am migrating my project to Phalcon and on my local server everything works fine with the database(the same as deployed in the server) but when I upload it to my server it won't load because it looks like it cannot find the models. It is everything ok with the directory in the loader and the db config file. I already checked but when I check the log this is what I get:

2014/11/15 20:06:12 [error] 31200#0: *178810 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'Uploads' not found in /home/XXXX/public_html/app/controllers/IndexController.php on line 22" while reading response header from upstream, client: 84.94.183.XXX, server: dev.XXXX.com, request: "GET /XXXX HTTP/1.1", upstream: "fastcgi://unix:/usr/local/php/var/run/php-test.sock:", host: "dev.XXXX.com.br"

Can someone give me a light?

PS: I am not using a different namespace PS2: As stated I am using the same structure in local and remote server.

Thanks!



7.9k
Accepted
answer

You are developing in windows? and deploying in linux?

try check file name and folder name when it come in linux everything is case sensitive.

for example if your file located in App/File.php

and your php code

include 'app/file.php';

it probably class not found in linux



1.3k

Thanks Prasetyo,

Changed the model name (that was all lower case) to Capital First letter and then all went well!

Thanks

You are developing in windows? and deploying in linux?

try check file name and folder name when it come in linux everything is case sensitive.

for example if your file located in App/File.php

and your php code

include 'app/file.php';

it probably class not found in linux