【问题标题】:Getting Error when Moving Laravel site to Localhost将 Laravel 站点移动到 Localhost 时出错
【发布时间】:2016-03-24 21:11:00
【问题描述】:

我是 laravel 的新手,我的测试服务器中有一个 laravel 站点。现在我想将该站点转移到 localhost。 我已将数据库连接更改为 app/config/database.php

但是当我运行该网站时,它给了我一个错误

我的 composer.json 代码如下所示

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.2.*",
        "cartalyst/sentry": "2.1.*",
        "thujohn/pdf": "dev-master"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

请帮助我在本地系统中运行该站点

【问题讨论】:

  • 您必须添加已安装软件包的服务提供商。
  • 我该怎么做? @SetKyarWaLar
  • 检查您的local/app.php 服务提供者数组和app.php 服务提供者数组。
  • 'Dinesh\Barcode\BarcodeServiceProvider',已经在服务提供者数组中,但文件位置不同 app/config/app.php @SetKyarWaLar。我的 laravel 版本是 4.2

标签: php laravel composer-php


【解决方案1】:

首先通过 Composer 安装这个包。编辑项目的 composer.json 文件以要求 dinesh/barcode。

"require": {
    "laravel/framework": "5.0.x",
    "dinesh/barcode": "5.0.*@dev"
}

接下来,从终端更新 Composer:

composer update

【讨论】:

  • @KaranAdhikari 那是不可能的,它与整个网站无关,只是那个类,你一定在其他地方做错了。
  • 您是否也添加了这一行"laravel/framework": "5.0.x",?如果你这样做了,你就不应该这样做。
猜你喜欢
  • 2013-04-17
  • 2016-09-03
  • 1970-01-01
  • 1970-01-01
  • 2016-01-04
  • 2014-10-29
  • 1970-01-01
  • 2013-12-02
  • 1970-01-01
相关资源
最近更新 更多