简体   繁体   English

laravel在部署服务器中找不到类

[英]laravel not class found in deployment server

I have a Laravel 4 application working fine on my local machine. 我有一个Laravel 4应用程序,可以在本地计算机上正常工作。 I've cloned it onto my VPS. 我已经将其克隆到我的VPS上。 When I run composer install or composer update, I get errors that "class not found". 当我运行composer安装或composer更新时,出现“找不到类”的错误。 I've checked vendor/composer/autoload_classmap.php and my classes are there. 我检查了vendor / composer / autoload_classmap.php,我的课在那里。 The class is located in the standard app/models/. 该类位于标准的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 本地:PHP版本5.5.10 VPS:PHP版本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/ Role.php位于应用程序/模型/

Edit2: Added route 编辑2:添加路线

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. 一切在本地计算机上也可以正常工作。

I found the problem with the help of others. 我在别人的帮助下发现了问题。 MY VPS did not support short tags. 我的VPS不支持短标签。 My Role.php began with <? 我的Role.php始于<? . I corrected it with <?php and everything works. 我用<?php更正了它,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM