AI Studio can’t create PHP files — “An internal error occurred”

Hi Google team :waving_hand:

I’m facing an issue while using Google AI Studio (Apps).
Whenever I try to create or modify a PHP file, the app throws this error:

error: [file-name].php  
error: An internal error occurred

It seems like AI Studio doesn’t allow generating or saving .php files at all.

I tried:

  • Renaming the file

  • Moving it to a different folder

  • Regenerating the app

  • All gave the same result

However, when I use JavaScript (.js) or TypeScript (.ts) files instead, everything works fine.

Here’s a simple workaround I’m currently using:

// example.js
export default async function handler(req, res) {
  try {
    // backend logic here
    res.json({ success: true });
  } catch (err) {
    console.error(err);
    res.status(500).json({ error: "Internal Server Error" });
  }
}

Could you please confirm if PHP files are currently unsupported in AI Studio,
or if this is a temporary bug that will be fixed soon?

Thanks in advance :folded_hands:

1 Like