简体   繁体   English

使用 GitHub 将 Laravel 部署到 azure windows web 应用程序给出错误需要 ext-fileinfo * -> 它从您的系统中丢失

[英]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.

相关问题 尝试使用 composer 安装 Laravel,它说“系统中缺少请求的 PHP 扩展文件信息” - Trying to install Laravel using composer and it says "the requested PHP extension fileinfo is missing from your system" Composer 错误:“您的系统缺少 PHP 扩展文件信息” - Composer error: "PHP extension fileinfo is missing from your system" Ubuntu 18.04:laravel/framework v6.9.0 需要 ext-mbstring * -> 系统中缺少请求的 PHP 扩展 mbstring - Ubuntu 18.04: laravel/framework v6.9.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system 如何解决“laravel/horizon v1.1.0 需要 ext-pcntl * -> 您的系统中缺少请求的 PHP 扩展 pcntl”? - How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"? 您的系统缺少扩展名 gd - laravel 作曲家更新 - Extension gd is missing from your system - laravel composer Update ext-imagick * -> 系统中缺少请求的 PHP 扩展 imagick - ext-imagick * -> the requested PHP extension imagick is missing from your system 在 Yii2 中更新 Composer 时,系统中缺少请求的 PHP 扩展 ext-soap * - The requested PHP extension ext-soap * is missing from your system when updating composer in Yii2 Laravel项目的Azure Web App错误404 - Azure Web App error 404 with Laravel project Laravel 项目部署给出 HTTP ERROR 500 - Laravel project deployment gives the HTTP ERROR 500 Laravel:运行队列:在 Windows Azure Web 应用程序上持续监听 - Laravel: Running queue:listen continuously on Windows Azure Web App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM