0

We have written an application in PHP that we're about to deploy to Azure that utilizes a few PHP extensions, such as ImageMagick.

Since Azure PHP 8.0 and 8.1 as runtime is now only available on Linux, I would like to know if there is a way to install custom extensions and keep them even after a restart of the app service?

If I'm not mistaken, these instances are pre-defined docker containers and the site will just be assigned a new container pointing to the PHP files in the persistent storage upon restarting, so whatever we may install to the specific instance via SSH will not be persisted. This was at least the outcome of my last attempt.

I'm no expert with docker nor Linux, so any help is appreciated.

Harshitha
  • 3,784
  • 2
  • 4
  • 9
Daniel Forslund
  • 241
  • 1
  • 8
  • For the extension to persist if the container restarts, we need to create a directory with name `ex` under the `site` folder and copy the required extension to the newly created directory. – Harshitha Oct 27 '22 at 11:15
  • @Daniel Forslund You can add the extensions using pecl in your docker file as mentioned in this [blog post](https://olvlvl.com/2019-06-install-php-ext-source#:~:text=Installing%20extensions,-Installing%20extensions%20manually&text=Create%20the%20corresponding%20directory%20in,install%20to%20install%20the%20extension.) – VenkateshDodda Oct 27 '22 at 11:48

0 Answers0