dongmibeng5885 2017-01-03 17:32
浏览 53
已采纳

将Laravel项目移至托管

I'm trying to move laravel project to host Virtualmin, I moved all folders in my Document root

HOME/
   MYPWD/
      APP/
      BOOTSTRAP/
      CONFIG/
      DATABASE/
      ....
      PUBLIC_HTML/

Inside PUBLIC_HTML I have the index.php with these lines:

require __DIR__ . '/../bootstrap/autoload.php';
$app = require_once __DIR__ . '/../bootstrap/app.php';

The login.php page work right, but after login, the browser return an error caused by recursively redirect. In logs I get this error:

exception 'ReflectionException' with message 'Class App\Http\Middleware\isNotAuth does not exist' in /home/mypwd/vendor/laravel/framework/src/Illuminate/Container/Container.php:734

I should change something else? Like namespace?

That's my composer.json file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "doctrine/dbal": "^2.5",
        "laravelcollective/html": "^5.2",
        "symfony/event-dispatcher": "^3.2",
        "psr/log": "^1.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

While that's my .gitignore file:

/vendor
/node_modules
/public/storage
Homestead.yaml
Homestead.json
.env
  • 写回答

1条回答 默认 最新

  • dongmi19720408 2017-01-04 10:41
    关注

    I resolve myself the problem: server linux is case sensitive, so in Kernel.php I called middleware class with IsNotAuth, but filename was isNotAuth

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)