Dear Laravel Users,
I just got to know a few days ago about Laravel (=> I'm a "stupid starter user"). Probably it is just a simple thing... the point is that I wanted to check one simple task: connection to a database following the steps described at http://laravel.com/docs/quick. When finished, I got this message: Symfony \ Component \ Debug \ Exception \ FatalErrorException Class 'User' not found
FYI: The complete output on the browser is below...
Any hint and help is very welcome!
Thanks and best regards, Francisco
_______________ Laravel Output Message _______________ Symfony \ Component \ Debug \ Exception \ FatalErrorException Class 'User' not found open: /home/fortizmu/webapps/test_laravel/app/routes.php return View::make('hello'); });
Route::get('users', function() { //return 'Users!'; //return View::make('users'); $users = User::all(); return View::make('users')->with('users', $users); }); Server/Request Data PATH /usr/local/bin:/usr/bin:/bin REDIRECT_HANDLER php55-cgi REDIRECT_STATUS 200 PHP_INI_SCAN_DIR /home/fortizmu/webapps/test_laravel SCRIPT_URL /public/users SCRIPT_URI http://laraveltest.sumutec.com/public/users HTTPS off HTTP_HOST laraveltest.sumutec.com HTTP_X_FORWARDED_HOST laraveltest.sumutec.com HTTP_X_FORWARDED_SERVER laraveltest.sumutec.com HTTP_X_FORWARDED_FOR 79.154.243.91 HTTP_FORWARDED_REQUEST_URI /public/users HTTP_HTTP_X_FORWARDED_PROTO http HTTP_HTTPS off HTTP_X_FORWARDED_PROTO http HTTP_X_FORWARDED_SSL off HTTP_CONNECTION close HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 HTTP_USER_AGENT Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 HTTP_ACCEPT_ENCODING gzip,deflate,sdch HTTP_ACCEPT_LANGUAGE es,en-GB;q=0.8,en;q=0.6,de-DE;q=0.4,de;q=0.2,ca;q=0.2,pt;q=0.2,it;q=0.2,nl;q=0.2 HTTP_COOKIE laravel_session=eyJpdiI6IjZhV1lIQk9oTFNRUVwvXC9iRlNKMm5DUWhNd1wvd3lTUGpod1VRNTFNQWIzY1k9IiwidmFsdWUiOiJNYjl6azRZZEVuYmF5QlhJUGY2ZmNGcjRcL1FYM0tuVTJSVVVOUGxTRGJ3czNBaUZVWkZ1RVdvb1FXdVVtOVY0OWg1bGZzK2lHMDMzdjZ4c01TS3I0QXc9PSIsIm1hYyI6ImUyNTkzZGNhZWY2YTkxZmIxZGQzNzAzZjdlN2RmYTZhZjk0NzYwYTVhNmM2OGY1Nzc3ZWViZDVhZDFmNmNmOWYifQ%3D%3D SERVER_SIGNATURE SERVER_SOFTWARE Apache SERVER_NAME laraveltest.sumutec.com SERVER_ADDR 127.0.0.1 SERVER_PORT 80 REMOTE_ADDR 79.154.243.91 DOCUMENT_ROOT /home/fortizmu/webapps/test_laravel SERVER_ADMIN [no address given] SCRIPT_FILENAME /home/fortizmu/webapps/test_laravel/public/index.php REMOTE_PORT 32830 REDIRECT_URL /public/index.php GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.0 REQUEST_METHOD GET QUERY_STRING REQUEST_URI /public/users SCRIPT_NAME /public/index.php ORIG_SCRIPT_FILENAME /home/php-cgi/php55.cgi ORIG_PATH_INFO /public/index.php ORIG_PATH_TRANSLATED /home/fortizmu/webapps/test_laravel/public/index.php ORIG_SCRIPT_NAME /cgi-bin/php55.cgi PHP_SELF /public/index.php REQUEST_TIME_FLOAT 1393495660.4501 REQUEST_TIME 1393495660 argv Array ( ) argc 0 GET Data empty POST Data empty Files empty Cookies laravel_session eyJpdiI6IjZhV1lIQk9oTFNRUVwvXC9iRlNKMm5DUWhNd1wvd3lTUGpod1VRNTFNQWIzY1k9IiwidmFsdWUiOiJNYjl6azRZZEVuYmF5QlhJUGY2ZmNGcjRcL1FYM0tuVTJSVVVOUGxTRGJ3czNBaUZVWkZ1RVdvb1FXdVVtOVY0OWg1bGZzK2lHMDMzdjZ4c01TS3I0QXc9PSIsIm1hYyI6ImUyNTkzZGNhZWY2YTkxZmIxZGQzNzAzZjdlN2RmYTZhZjk0NzYwYTVhNmM2OGY1Nzc3ZWViZDVhZDFmNmNmOWYifQ== Session empty Environment Variables PATH /usr/local/bin:/usr/bin:/bin REDIRECT_HANDLER php55-cgi REDIRECT_STATUS 200 PHP_INI_SCAN_DIR /home/fortizmu/webapps/test_laravel SCRIPT_URL /public/users SCRIPT_URI http://laraveltest.sumutec.com/public/users HTTPS off HTTP_HOST laraveltest.sumutec.com HTTP_X_FORWARDED_HOST laraveltest.sumutec.com HTTP_X_FORWARDED_SERVER laraveltest.sumutec.com HTTP_X_FORWARDED_FOR 79.154.243.91 HTTP_FORWARDED_REQUEST_URI /public/users HTTP_HTTP_X_FORWARDED_PROTO http HTTP_HTTPS off HTTP_X_FORWARDED_PROTO http HTTP_X_FORWARDED_SSL off HTTP_CONNECTION close HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 HTTP_USER_AGENT Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 HTTP_ACCEPT_ENCODING gzip,deflate,sdch HTTP_ACCEPT_LANGUAGE es,en-GB;q=0.8,en;q=0.6,de-DE;q=0.4,de;q=0.2,ca;q=0.2,pt;q=0.2,it;q=0.2,nl;q=0.2 HTTP_COOKIE laravel_session=eyJpdiI6IjZhV1lIQk9oTFNRUVwvXC9iRlNKMm5DUWhNd1wvd3lTUGpod1VRNTFNQWIzY1k9IiwidmFsdWUiOiJNYjl6azRZZEVuYmF5QlhJUGY2ZmNGcjRcL1FYM0tuVTJSVVVOUGxTRGJ3czNBaUZVWkZ1RVdvb1FXdVVtOVY0OWg1bGZzK2lHMDMzdjZ4c01TS3I0QXc9PSIsIm1hYyI6ImUyNTkzZGNhZWY2YTkxZmIxZGQzNzAzZjdlN2RmYTZhZjk0NzYwYTVhNmM2OGY1Nzc3ZWViZDVhZDFmNmNmOWYifQ%3D%3D SERVER_SIGNATURE SERVER_SOFTWARE Apache SERVER_NAME laraveltest.sumutec.com SERVER_ADDR 127.0.0.1 SERVER_PORT 80 REMOTE_ADDR 79.154.243.91 DOCUMENT_ROOT /home/fortizmu/webapps/test_laravel SERVER_ADMIN [no address given] SCRIPT_FILENAME /home/fortizmu/webapps/test_laravel/public/index.php REMOTE_PORT 32830 REDIRECT_URL /public/index.php GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.0 REQUEST_METHOD GET QUERY_STRING REQUEST_URI /public/users SCRIPT_NAME /public/index.php ORIG_SCRIPT_FILENAME /home/php-cgi/php55.cgi ORIG_PATH_INFO /public/index.php ORIG_PATH_TRANSLATED /home/fortizmu/webapps/test_laravel/public/index.php ORIG_SCRIPT_NAME /cgi-bin/php55.cgi Registered Handlers 0. Whoops\Handler\PrettyPageHandler
In your app/models folder, do you have a User.php file?
I find whenever Laravel can't find a class, the best first step to try is running 'composer dump-autoload'. Might be as simple as that?
ChrisSoutham said:
In your app/models folder, do you have a User.php file?
Hi Chris, thanks! Yes, I do! [fortizmu@web433 models]$ ll total 8 -rw-rw-r-- 1 fortizmu fortizmu 843 Feb 15 04:44 User-orig.php -rw-rw-r-- 1 fortizmu fortizmu 31 Feb 27 09:56 User.php
The contents are just what is what written in the "http://laravel.com/docs/quick": class User extends Eloquent {}
cgoosey1 said:
I find whenever Laravel can't find a class, the best first step to try is running 'composer dump-autoload'. Might be as simple as that?
Hi! I've tried... but same result :-( Could it be that the app is being served at http://laraveltest.sumutec.com/public/users instead of at http://laraveltest.sumutec.com/users ?
Hello! Now it is finally working! :-)
I just used the app/models/User.php that is originally generated during Laravel installation (which I replaced with the one mentioned here http://laravel.com/docs/quick -> "Eloquent ORM"). This instruction was misleading for me...
Ok, for now, it is working :-)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community