Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
PHP-Version angeben
Standardmäßig verwendet das PHP-Laufzeit-Buildpack die aktuellste stabile Version von PHP. Wenn Ihre Anwendung eine bestimmte Version erfordert, können Sie eine angeben. Dazu schließen Sie eine composer.json-Datei in das Stammverzeichnis Ihrer Anwendung ein. Beispiel:
"require":{"php":"8.3.*",}
Composer konfigurieren
Die Composer-Version ist standardmäßig 2.1.3. Wenn Sie eine bestimmte Version von Composer benötigen, können Sie mit der Umgebungsvariable GOOGLE_COMPOSER_VERSION eine unterstützte Version von Composer mit der vollständigen semantischen Version angeben. Beispiel:
Zum Konfigurieren von NGINX können Sie die Umgebungsvariable GOOGLE_CUSTOM_NGINX_CONFIG verwenden, um Ihre benutzerdefinierte NGINX-Konfigurationsdatei anzugeben. Beispiel:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-12 (UTC)."],[[["\u003cp\u003eYou can specify a particular PHP version for your application by defining it in the \u003ccode\u003ecomposer.json\u003c/code\u003e file, such as \u003ccode\u003e"php": "8.3.*"\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe default Composer version is \u003ccode\u003e2.1.3\u003c/code\u003e, but you can set a different supported version using the \u003ccode\u003eGOOGLE_COMPOSER_VERSION\u003c/code\u003e environment variable.\u003c/p\u003e\n"],["\u003cp\u003eCustom NGINX configurations can be implemented by specifying a custom configuration file using the \u003ccode\u003eGOOGLE_CUSTOM_NGINX_CONFIG\u003c/code\u003e environment variable.\u003c/p\u003e\n"]]],[],null,["# Building a PHP application\n\nSpecify the PHP version\n-----------------------\n\nBy default the PHP Runtime buildpack uses the latest stable version of PHP. If\nyour application requires a specific version, you can specify one by including\na `composer.json` file in your application's root directory. For example: \n\n \"require\": {\n \"php\": \"8.3.*\",\n }\n\nConfigure Composer\n------------------\n\nBy default, the Composer version is `2.1.3`. If you require a specific\nversion of Composer, you can use the `GOOGLE_COMPOSER_VERSION` environment\nvariable to specify any supported version of Composer using the full\nsemantic version. For example: \n\n pack build sample-php --builder=gcr.io/buildpacks/builder \\\n --env GOOGLE_COMPOSER_VERSION=\"2.2.20\"\n\nCustomizing NGINX configurations\n--------------------------------\n\nTo configure NGINX, you can use the `GOOGLE_CUSTOM_NGINX_CONFIG` environment\nvariable to specify your custom NGINX configuration file. For example: \n\n pack build sample-php --builder=gcr.io/buildpacks/builder \\\n --env GOOGLE_CUSTOM_NGINX_CONFIG=\"nginx-custom.conf\"\n\nWhen NGINX starts, your custom NGINX file is used."]]