Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GAE PHP 8.2 GD extension not working?

It seems that GD functions are missing despite documentation stating that GD extensions are enabled by default - according to this.

I noticed that after I migrated my app from PHP 7 to PHP 8.2 environment and imagecreatefromwebp was not found - it worked fine in PHP 7 environment!
I tried putting "extension=gd" in php.ini but it causes the deployment to fail.

Is this a bug or I'm missing something?

0 2 598
2 REPLIES 2

Hi @jacklul,

Welcome to Google Cloud Community!

You're running into a known discrepancy between the development environment and production for GAE's PHP runtime.

Here's what's happening:

  • The documentation is correct – the GD extension is enabled by default in the production environment for GAE's PHP 8.2 runtime.
  • The development server included with the GAE SDK might not have the GD extension enabled by default. This explains why imagecreatefromwebp worked in PHP 7 but not 8.2.

Recommended: Use a custom PHP interpreter with GD enabled during local development. This ensures your development environment matches production.

My app is currently deployed with php82 runtime and it is where the issue is happening, I do not mean local dev server here.

Edit: it seems like it's known issue and awaiting a fix... https://issuetracker.google.com/issues/282297737