Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

harristars's avatar

FatalErrorException in PostController.php line 12: Class 'App\Post' not found

i get this error when i try to login to the system using this link i am using this username: [email protected] password :haa1234 .what mint be the problem with the server or the hosting server because in the local machine its working fine.

http://entrepreneurbase.haoyetu.com
0 likes
16 replies
harristars's avatar

@tomi where do i run composer dump-autoload on the server or local machine

harristars's avatar

can i use putty to access the c panel server and run composer update .

tomopongrac's avatar

I didn't try with that approach so i can tell ...

so you upload to server all your files ... including vendor directory?

harristars's avatar

@tomi yah everything is in the server.the hosting company told me that they dont support laravel framework when i asked them.cuold that be the problem

harristars's avatar

@tomi everything is working in app\Http\Controllers\PostController.php in the local machine

ejdelmonico's avatar

First off, jQuery is not loading. Check your code or include it before bootstrap.js

Second, you can use putty to ssh into hosting and install composer (unless they block it) and run composer methods.

Gog0's avatar

Did you check if it could be a problem about case sensitivity? If your local machine is using Windows then it doesn't care about case sensitivity, which could explain why it works on your local machine and not on the server if the server is a linux one.

So check in your code that you use a capital P for Post everywhere (class name, use statements, ...)

harristars's avatar

@Gog0 should i change the class name and statement instead or what you mean

Gog0's avatar
Gog0
Best Answer
Level 2

@harristars what I'm saying is that you have to make sure that everything is consistent in your application. As it's a convention to start class names with a capital letter your model class should be named Post, your file called Post.php and you should use EXACTLY Post everywhere and not post or any other variation when using use, creating an instance, etc...

Just check everything is the same everywhere. But maybe it's not your problem, it's just a guess as it happens to people sometimes.

harristars's avatar

@Gog0 thanks it have worked the problem was post.phpit should be Post.php

Please or to participate in this conversation.