Managing PHP function dependencies
Written by
Updated at July 2, 2026
Cloud Functions can automatically install dependencies required for a PHP function when creating a new function version.
To install dependencies, use the composer install command that runs in the project root (function directory). You can list the required libraries in the following ways:
-
Specify the libraries and their versions in the
composer.jsonfile:{ "require": { "guzzlehttp/guzzle": "~6.0", "ext-json": "*" } } -
Run the
composer require <library>command in the project root. This adds the library to thecomposer.jsonfile and installs it to thevendordirectory.
The dependency installation process has some technical limitations. For more information, see Quotas and limits in Cloud Functions. You can view the dependency installation log via the link displayed in the list of operations.