1

I have a Laravel 4 application working fine on my local machine. I've cloned it onto my VPS. When I run composer install or composer update, I get errors that "class not found". I've checked vendor/composer/autoload_classmap.php and my classes are there. The class is located in the standard app/models/. I removed some code, which finally allowed the composer to update. However none of my custom classes all located inside app/models are being loaded. Any ideas what's going on? Thanks.

Local: php version 5.5.10 VPS: php version 5.5.9

Edit: Included error log

[2014-10-23 02:50:37] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'Role' not found' in ../app/routes.php:214
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []

Role.php is located in app/models/

Edit2: Added route

Route::group(array('before' => 'auth.admin'), function() {

    $roles  = new Role();

    Route::get('/help', array(
        'as' => 'help',
        'uses' => 'HelpController@getHelp'
    ));
}

This isn't the full route, but that's essential it. Everything works fine on local machine also.

12
  • Please post your error here to let us know more detail. Commented Oct 23, 2014 at 6:20
  • Can you provide your routes.php? This seems like a namespacing-issue. Commented Oct 23, 2014 at 7:14
  • Everything do seem fine; does composer update and composer dumpautoload complete without errors? Commented Oct 23, 2014 at 7:21
  • Check that your Role class is inside the Role.php file. If you develop on Windows machine, the file name is case insensible while your Linux VPS cares the differences between Role.php and role.php Commented Oct 23, 2014 at 7:22
  • composer complained about the same error. I commented out the $roles = new Role() and the composer was able to run. Then when I load the page, I get that error in the error log. Commented Oct 23, 2014 at 7:23

1 Answer 1

2

I found the problem with the help of others. MY VPS did not support short tags. My Role.php began with <?. I corrected it with <?php and everything works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.