0
votes

I've been searching on how add a custom extensionsqlsrv to my PHP runtime on Google Cloud's App Engine.

After going through the documentation on app engine, I found that there are pre-installed modules and some other modules which can be activated ( https://cloud.google.com/appengine/docs/standard/php/runtime#enabled_extensions )

But however, I cannot seem to find away to connect to a SQL Server instance as the sqlsrv_connect extension is not available and my code base highly depends on it. https://www.php.net/manual/en/function.sqlsrv-connect.php

Can someone guide me on how to get this extension enabled on my app engine standard environment?

error: Uncaught Error: Call to undefined function sqlsrv_connect()
1

1 Answers

0
votes

I think that the best approach for this is to create your own custom runtime and deploy the Custom Runtime with the Dockerfile at the root of your app's folder on App Engine Flex.

As mentioned in the The PHP Runtime documentation of the App Engine Flex, you can enable an extension by adding a php.ini to the root of your app before deploying it.

For installing the drivers you will need to extend the runtime by creating a custom one, based on the basic PHP runtime available for App Engine. This will generate a Dockerfile in which you can add the necessary steps to install what you need.