gpt4 book ai didi

php - Laravel 5.3 使用命令 composer install --no-dev 在 ubuntu16.04 nginx 中上传

转载 作者:行者123 更新时间:2023-12-04 18:45:59 24 4
gpt4 key购买 nike

每次我运行命令 Composer install --no-dev我收到此错误,我在 laravel 中使用 maatwebsite 作为错误指出,我只是不知道如何解决它。

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError
: Class 'PHPExcel_Shared_Font' not found in /var/www/laravel/config/excel.php:18
2 Stack trace:

0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap

/LoadConfiguration.php(60): require()

1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap

/LoadConfiguration.php(38): Illuminate\Foundation\Bootstrap\LoadConfiguration->l
oadConfigurationFiles(Object(Illuminate\Foundation\Application), Object(Illumina
te\Config\Repository))

2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Applicati

on.php(203): Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap(Object
(Illuminate\Foundation\Application))

3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/K

ernel.php(268): Illuminate\Foundation\Application->bootstrapWith(Array)

4 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/K

ernel.php(114): Illuminate\Foundation\Console\Kernel->boo in /var/www/laravel/co
nfig/excel.php on line 182 Script php artisan optimize handling the post-install-cmd event returned with er
ror code 255



更新:
这是 composer.json 文件内容
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"maatwebsite/excel": "~2.1.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || 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"
}
}

最佳答案

我假设您收到此错误的原因是因为您正在运行 --no-dev你有maatwebsite/excel列为 require-dev依赖。

您需要将其作为开发依赖项删除,然后将其作为正常依赖项要求,它应该没问题。

希望这可以帮助!

关于php - Laravel 5.3 使用命令 composer install --no-dev 在 ubuntu16.04 nginx 中上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40238745/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com