Skip to content

Is Guzzle built into PHP?

Guzzle is not part of PHP itself.

OUTPUT FORMATSHTMLJSONMarkdown

Treat it like any other external dependency: add it to your project first, then import the client class when you need to make HTTP requests and work with the responses.

A separate package, not a core feature

PHP ships with its own core extensions, but Guzzle sits outside that set. If your code tries to instantiate the Guzzle client on a machine where the package was never installed, the class will simply not be available. The fix is a project-level installation step, not a PHP configuration change.

Install it, then import it

Composer is the usual route for managing PHP dependencies, and it is the approach recommended for this library. Run the install command supplied in protected module code0001 from your project root. Once Composer has added the package, bring the client into scope with the import statement in protected module code0002, and you can call its API to dispatch HTTP requests and process what comes back.

Setup checklist

Before writing request code, work through this short check:

  • Confirm the project uses Composer for dependency management.
  • Run the install command from protected module code0001.
  • Verify the package appears in the project's dependency list.
  • Add the import from protected module code0002 at the top of the file that will use the client.
  • Only then write code that sends requests and handles responses.

Skipping the installation step is the most common reason this setup fails on a new machine.

Related Guzzle questions

Once the basics are in place, the next questions usually concern specific behaviours: authentication, certificate handling, error handling, proxies, and request formats. Those are separate topics from the installation question answered here.

Frequently asked questions

Does PHP include Guzzle out of the box?

No. It is an external package, so a fresh PHP installation will not contain it until you add it as a dependency.

What is the recommended way to add Guzzle to a project?

Use Composer, the standard dependency manager for PHP projects, to add the package before importing its client class in your code.