It is important to know if you are using a flexible or standard environment since flex environment is compatible with PHP 7.2 and 7.3 runtimes, and standard is compatible with PHP 8.1, but in its preview phase [1], [2]. You can use PHP 8.1 in flex environment, but you need to use custom runtimes [5] and provide a custom Docker image or Dockerfile from the open source community.
How to know if you are in a Standard or Flexible environment:
In your app.yaml, find the runtime line.
If it looks similar to the following:
runtime: php81 # Replace with php74 to use PHP 7.4
Then you are running under a standard environment [3].
And if it looks like this other example:
runtime: python
env: flex
runtime_config:
python_version: 3
Then you are using a flexible environment for the deployment [4].
[1]:https://cloud.google.com/appengine/docs/php
[2]:https://cloud.google.com/appengine/docs/the-appengine-environments
[3]:https://cloud.google.com/appengine/docs/standard/php-gen2/config/appref
[4]:https://cloud.google.com/appengine/docs/flexible/python/reference/app-yaml#general
[5]:https://cloud.google.com/appengine/docs/flexible/custom-runtimes/quickstart