Installation

The recommended way to install Guzzle is with Composer. Composer is a dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project.

  1. # Install Composer
  2. curl -sS https://getcomposer.org/installer | php

You can add Guzzle as a dependency using the composer.phar CLI:

  1. php composer.phar require guzzlehttp/guzzle:~6.0

Alternatively, you can specify Guzzle as a dependency in your project’s existing composer.json file:

  1. {
  2. "require": {
  3. "guzzlehttp/guzzle": "~6.0"
  4. }
  5. }

After installing, you need to require Composer’s autoloader:

  1. require 'vendor/autoload.php';

You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.

Bleeding edge

During your development, you can keep up with the latest changes on the master branch by setting the version requirement for Guzzle to ~6.0@dev.

  1. {
  2. "require": {
  3. "guzzlehttp/guzzle": "~6.0@dev"
  4. }
  5. }