如何使用Windows安装干预图像

时间:2015-05-20 23:18:07

标签: php laravel intervention

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

php composer.phar require intervention/image

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

我错过了一些非常简单的事情吗?

5 个答案:

答案 0 :(得分:5)

正如Sinan Bolel在Windows中提到的,而不是“php composer.phar”,你输入“composer”和以下内容......

答案 1 :(得分:2)

首先,你指出项目目录,之后你应该运行" 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

答案 2 :(得分:0)

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

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

答案 3 :(得分:0)

使用此命令

composer require intervention/image

答案 4 :(得分:0)

composer require intervention/image

并在 config/app.php

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