Installation
Installing Intervention Image
2.9M Downloads / Month
Open Source MIT License
2.9M Downloads / Month
Open Source MIT License
Before you begin with the installation make sure that your server environment supports the following requirements.
Although it is not a requirement, it is highly recommended to have the Exif PHP extension installed as well. This is used, among other things, to correctly display the orientation of images.
Depending on your PHP installation Intervention Image lets you choose between two different image processing libraries.
Your server environment must support at least one of them. GD is part of most PHP installations. However I recommend using Imagick because I think it is faster and more efficient especially for larger images.
Install Intervention Image with Composer by running the following command.
composer require intervention/image
This will install Intervention Image with the most recent version, your
composer.json
is automatically updated and you will be able use the package's
classes via the autoloader. To do this you will need to require the just
created vendor/autoload.php
file to PSR-4 autoload all your installed
composer packages.
require './vendor/autoload.php';
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Imagick\Driver;
// create new manager instance with desired driver
$manager = new ImageManager(new Driver());
After installation you are ready to use the image manager and read or create image instances.
Edit