Thanks for the question! You may want to use the steps from the below blog to install the PHP extension.
Azure App Service Linux - Adding PHP Extensions
Also, if you need to include additional dependencies for Linux PHP app, you can use Composer to install them > use a .deployment file to invoke the custom deployment script to run “php composer.phar install” cmd.
Please refer to below tutorial link which shows how to use a .deployment file to invoke the custom deployment script to run “php composer.phar install” command.