The App Engine Standard Environment imposes restrictions, as apps run there in a sandbox. By contrast, the flexible environment runs your application in Docker containers on Google Compute Engine virtual machines (VMs), which have fewer restrictions. For example, you can use any programming language of your choice, write to disk, use any library you'd like, and even run multiple processes. This should allow you to try running the yii2 framework in the flexible environment. You may read more in-detail information on choosing an environment in the "App Engine Flexible Environment for Users of App Engine Standard Environment"
online document.