[英]Laravel deployment to azure windows web app using GitHub gives error requires ext-fileinfo * -> it is missing from your system
I am getting the following error when I try to deploy my laravel project to azure windows web app using github.当我尝试使用 github 将我的 laravel 项目部署到 azure windows web 应用程序时,出现以下错误。
but it is deploying fine if I use azure tool但如果我使用 azure 工具,它部署得很好
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v7.29.0, ..., 7.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.x-dev].
- league/flysystem[1.1.0, ..., 1.x-dev] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^7.29 -> satisfiable by laravel/framework[v7.29.0, ..., 7.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\tools\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
I have tried php --ini我试过 php --ini
C:\\Program Files(x86)\\PHP\\v7.4\\php.ini Scan for additional .ini files in: C:\\Program Files(x86)\\PHP\\v7.4\\php.ini 在以下位置扫描其他 .ini 文件:
and in that file it is enabled并在该文件中启用
extension=fileinfo
also here is my composer file这也是我的作曲家文件
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4 || ^8",
"doctrine/dbal": "^2.13",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
"laravel/framework": "^7.29",
"laravel/tinker": "^2.5",
"predis/predis": "^1.1",
"tcg/voyager": "^1.4",
"tymon/jwt-auth": "^1.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.3",
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"platform-check": false
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"repositories": {
"hooks": {
"type": "composer",
"url": "https://larapack.io"
}
}
}
After searching for 24 hours, I have found the solution.经过 24 小时的搜索,我找到了解决方案。 This is related to the php set up while deployment.
这与部署时设置的 php 相关。 To setup PHP with necessary extensions you will need to update your .yml file on GitHub repository (.github/workflows folder).
要使用必要的扩展设置 PHP,您需要更新 GitHub 存储库(.github/workflows 文件夹)上的 .yml 文件。
Add a new line to "Setup PHP >> with" step like "extensions: fileinfo"在“Setup PHP >> with”步骤中添加一个新行,例如“extensions: fileinfo”
If you need to enable any other extension, you can add all of the extensions as comma seperated.如果您需要启用任何其他扩展,您可以将所有扩展添加为逗号分隔。
Example:例子:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: fileinfo, pdo_mysql
Please read this documentation: https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support请阅读此文档: https : //github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.