I'm trying to deploy my PHP (CakePHP) application through Azure DevOps and install Composer dependencies in the build step of the pipeline, using a Windows hosted agent.
The composer install is failing because common PHP extensions (namely intl and fileinfo) are unavailable to the PHP executable running in the build. Once deployed, the Web App on Azure does have these extensions. The composer
web app extension is installed on the actual app service on Azure and there is a composer.phar
file in the root of the repository.
The step I'm trying to run is just php composer.phar install --no-scripts --no-interaction --optimize-autoloader
.
The pipeline fails with this error, but I have no idea how to access the .ini file or provide any options.
To enable extensions, verify that they are enabled in your .ini files:
- C:\tools\php\php.ini
PHP_INI_SCAN_DIR can be set, but this 'php template' from DevOps wipes out any added configuration properties when a new deploy happens. This also seems to be a totally different PHP than what the App Service actually runs. I can make a new template for config options, but the PHP extension issue seems to still be there on the build step.
If anyone knows how to simply have composer install dependencies and have them included in the build artifact (.zip file) created, I would greatly appreciate it. Thank you!
C:\tools\php\php.ini
to enable the extensions. for example run this command in pipeline scrpt task:echo "extension=intl" >> C:\tools\php\php.ini
– Levi Lu-MSFT