【问题标题】:How to install intervention image with Windows如何使用 Windows 安装干预映像
【发布时间】:2015-08-02 10:13:39
【问题描述】:

在 Intervention Image 的网站上,它说要安装最新版本,我必须运行以下命令:

php composer.phar require intervention/image

我使用的是 Windows 8.1,我想这不会起作用。我已经尝试过了,它说:无法打开输入文件:composer.phar

我错过了一些很容易的事情吗?

【问题讨论】:

标签: php laravel intervention


【解决方案1】:

要使用composer,首先需要安装它。

https://getcomposer.org/doc/00-intro.md#installation-windows

【讨论】:

    【解决方案2】:

    正如 Sinan Bolel 提到的,在 Windows 中,输入“composer”而不是“php composer.phar”,然后...

    【讨论】:

      【解决方案3】:

      首先你指向你的项目目录,然后你应该运行“composer需要干预/图像”命令。

      你的结果是这样的

      Admin@Admin-dell MINGW64 /c/xampp/htdocs/laravel_dev
      $ composer require intervention/image
      Using version ^2.3 for intervention/image
      ./composer.json has been updated
      Loading composer repositories with package information
      Updating dependencies (including require-dev)
        - Installing psr/http-message (1.0)
          Loading from cache
      
        - Installing guzzlehttp/psr7 (1.3.0)
          Loading from cache
      
        - Installing intervention/image (2.3.7)
          Downloading: 100%
      
      intervention/image suggests installing ext-imagick (to use Imagick based image processing.)
      intervention/image suggests installing intervention/imagecache (Caching extension for the Intervention Image library)
      Writing lock file
      Generating autoload files
      > Illuminate\Foundation\ComposerScripts::postUpdate
      > php artisan optimize
      Generating optimized class loader
      
      Admin@Admin-dell MINGW64 /c/xampp/htdocs/laravel_dev
      

      【讨论】:

        【解决方案4】:

        使用这个命令

        composer require intervention/image
        

        【讨论】:

        • 这已经是答案的一部分,你应该投票而不是重复
        【解决方案5】:
        composer require intervention/image
        

        并在 config/app.php

        return [
            ...
            $provides => [
                ...
                Intervention\Image\ImageServiceProvider::class
            ],
            $aliases => [
                ...
                'Image' => Intervention\Image\Facades\Image::class
            ]
        ]
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2014-07-29
          • 1970-01-01
          • 1970-01-01
          • 2017-02-22
          • 1970-01-01
          • 2017-11-09
          • 1970-01-01
          相关资源
          最近更新 更多