php 未找到Class 'Website\Excel\Excel'

kjthegm6  于 12个月前  发布在  PHP
关注(0)|答案(2)|浏览(181)

我的composer.json

...
    "maatwebsite/excel": "^3.0",
    ...

字符串
我可以在localhost上运行我的项目,但当我在服务器上上传时,我得到了这个错误消息:

Class 'Maatwebsite\Excel\Excel' not found


我的laravel版本:

Laravel Framework 5.5.40


我的公共目录:


的数据
public_html/public/index.php

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels great to relax.
|
*/

require __DIR__.'/../bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

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

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);


我的网站:
http://alsatmarketing.com/

更新

在运行composer require maatwebsite/excel:^3.0之后,我得到了这个错误:

Problem 1
    - Installation request for maatwebsite/excel 3.0 -> satisfiable by maatwebsite/excel[3.0.0].
    - Conclusion: remove laravel/framework v5.5.40
    - Conclusion: don't install laravel/framework v5.5.40
    - maatwebsite/excel 3.0.0 requires illuminate/support ^5.6 -> satisfiable by illuminate/support[v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17,
v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.3, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9].
    - don't install illuminate/support v5.6.4|don't install laravel/framework v5.5.40
    - don't install illuminate/support v5.6.5|don't install laravel/framework v5.5.40
    - don't install illuminate/support v5.6.6|don't install laravel/framework v5.5.40
    - don't install illuminate/support v5.6.7|don't install laravel/framework v5.5.40
    - don't install illuminate/support v5.6.0|don't install laravel/framework v5.5.40
    - don't install illuminate/support v5.6.1|don't install laravel/framework v5.5.40
    - illuminate/support v5.6.10 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.11 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.12 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.13 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.14 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.15 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.16 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.17 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.19 conflicts with laravel/framework[v5.5.40].
    - don't install illuminate/support v5.6.2|don't install laravel/framework v5.5.40
    - illuminate/support v5.6.20 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.21 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.22 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.23 conflicts with laravel/framework[v5.5.40].
    - don't install illuminate/support v5.6.3|don't install laravel/framework v5.5.40
    - illuminate/support v5.6.8 conflicts with laravel/framework[v5.5.40].
    - illuminate/support v5.6.9 conflicts with laravel/framework[v5.5.40].
    - Installation request for laravel/framework (locked at v5.5.40, required as 5.5.*) -> satisfiable by laravel/framework[v5.5.40].

Installation failed, reverting ./composer.json to its original content.

afdcj2ne

afdcj2ne1#

试着跑步:
第一个月
(the问题注解中的命令可能会抱怨锁定文件)

wfsdck30

wfsdck302#

如果您使用Laravel 5.4,请运行此命令以安装composer

composer require maatwebsite/excel:~2.1

字符串

相关问题