Laravel 5中的Composer更新错误 - 找不到'PHPExcel_Shared_Font'

时间:2015-08-01 10:28:39

标签: laravel laravel-5 composer-php

我需要自定义我在packagist上找到的包,所以我克隆了github上的repo并更新了我的composer.json文件,以便从那里获得依赖。

现在,当我运行composer update时,我得到以下内容:

[4.5MB/0.34s] Loading composer repositories with package information
[4.8MB/1.57s] Updating dependencies (including require-dev)
[248.7MB/16.88s]   - Removing serverfireteam/blog (master)
[113.1MB/17.54s] Writing lock file
[113.1MB/17.55s] Generating autoload files

Fatal error: Class 'PHPExcel_Shared_Font' not found in C:\Users\Tim\Code\Laravel\config\excel.php on line 174
PHP Fatal error:  Class 'PHPExcel_Shared_Font' not found in C:\Users\Tim\Code\Laravel\config\excel.php on line 174
[113.4MB/18.22s] Script php artisan clear-compiled handling the post-update-cmd event returned with an error



  [RuntimeException]
  Error Output: PHP Fatal error:  Class 'PHPExcel_Shared_Font' not found in C:\Users\Tim\Code\Laravel\config\excel.php on line 174

我恭敬地改变了,并再次运行`composer update'并得到以下消息:

[4.4MB/0.33s] Loading composer repositories with package information
[4.7MB/1.48s] Updating dependencies (including require-dev)
[258.9MB/15.11s] Your requirements could not be resolved to an installable set of packages.
[258.9MB/15.11s]
  Problem 1
    - Conclusion: remove laravel/framework v5.0.33
    - Conclusion: don't install laravel/framework v5.0.33
    - Conclusion: don't install laravel/framework v5.0.32
    - Conclusion: don't install laravel/framework v5.0.31
    - Conclusion: don't install laravel/framework 5.0.30
    - Conclusion: don't install laravel/framework v5.0.29
    - Conclusion: don't install laravel/framework v5.0.28
    - Conclusion: don't install laravel/framework v5.0.27
    - Conclusion: don't install laravel/framework v5.0.26
    - Conclusion: don't install laravel/framework v5.0.25
    - Conclusion: don't install laravel/framework v5.0.24
    - Conclusion: don't install laravel/framework v5.0.23
    - Conclusion: don't install laravel/framework v5.0.22
    - Conclusion: don't install laravel/framework v5.0.21
    - Conclusion: don't install laravel/framework v5.0.20
    - Conclusion: don't install laravel/framework v5.0.19
    - Conclusion: don't install laravel/framework v5.0.18
    - Conclusion: don't install laravel/framework v5.0.17
    - Conclusion: don't install laravel/framework v5.0.16
    - Conclusion: don't install laravel/framework v5.0.15
    - Conclusion: don't install laravel/framework v5.0.14
    - Conclusion: don't install laravel/framework v5.0.13
    - Conclusion: don't install laravel/framework v5.0.12
    - Conclusion: don't install laravel/framework v5.0.11
    - Conclusion: don't install laravel/framework v5.0.10
    - Conclusion: don't install laravel/framework v5.0.9
    - Conclusion: don't install laravel/framework v5.0.8
    - Conclusion: don't install laravel/framework v5.0.7
    - Conclusion: don't install laravel/framework v5.0.6
    - Conclusion: don't install laravel/framework v5.0.5
    - Conclusion: don't install laravel/framework v5.0.4
    - Conclusion: don't install laravel/framework v5.0.3
    - Conclusion: don't install laravel/framework v5.0.2
    - Conclusion: don't install laravel/framework v5.0.1
    - serverfireteam/blog master requires illuminate/support ~5.1 -> satisfiable by illuminate/support[v5.1.1, v5.1.2, v5.1.6, v5.1.8].
    - serverfireteam/blog dev-master requires illuminate/support ~5.1 -> satisfiable by illuminate/support[v5.1.1, v5.1.2, v5.1.6, v5.1.8].
    - don't install illuminate/support v5.1.1|don't install laravel/framework v5.0.0
    - don't install illuminate/support v5.1.2|don't install laravel/framework v5.0.0
    - don't install illuminate/support v5.1.6|don't install laravel/framework v5.0.0
    - don't install illuminate/support v5.1.8|don't install laravel/framework v5.0.0
    - Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[5.0.30, v5.0.0, v5.0.1, v5.0.10, v5.0.11, v5.0.12, v5.0.13, v5.0.14, v5.0.15, v5.0.16, v5.0.17, v5.0.18, v5.0.19, v5.0.2, v5.0.20, v5.0.21, v5.0.22, v5.0.23, v5.0.24, v5.0.25, v5.0.26, v5.0.27, v5.0.28, v5.0.29, v5.0.3, v5.0.31, v5.0.32, v5.0.33, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9].
    - Installation request for serverfireteam/blog dev-master -> satisfiable by serverfireteam/blog[master].

[113.9MB/15.48s] Memory usage: 113.9MB (peak: 259.06MB), time: 15.48s

有谁知道我哪里出错了?

3 个答案:

答案 0 :(得分:3)

根据你自己的评论@TimothyBuktu,serverfireteam/blog需要laravel 5.1。

您希望在serverfireteam/blog中将dev-master#c0039d3ade67503d674093f3a56d7b1540ae958d的版本锁定为composer.json,这是laravel要求达到5.1之前的最后一次提交

或者,如果您仍希望收到程序包的更新,则需要将应用程序更新为laravel 5.1。 http://laravel.com/docs/5.1/upgrade

答案 1 :(得分:3)

删除config / excel.php并重新发布。 php artisan vendor:publish --provider=Maatwebsite\Excel\ExcelServiceProvider

答案 2 :(得分:1)

mm Xl 的回答很棒!

但是在3.1版本(包含)之后,命令改为如下:

php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider" --tag=config

要在文档中查看此部分:https://github.com/Maatwebsite/laravel-excel-docs/blob/develop/3.1/getting-started/installation.md