Suddenly all my PHP functions stopped working on Azure Functions within one App Service consumption plan. A few days later the same happened for my other Azure Function Apps that ran PHP.
Full error message:
[Info] Function started (Id=01a3bb97-a5a3-49d9-8a13-ac7330fcb9d0)
[Error] Exception while executing function: Functions.NAME. System: The system cannot find the file specified.
[Error] Function completed (Failure, Id=01a3bb97-a5a3-49d9-8a13-ac7330fcb9d0, Duration=120ms)
Other languages like Node still seem to work.
While investigating this issue I stumbled on the folder D:\Program Files\FixPHP72x64 with a last modified date that was equal to the timeframe that my functions started failing. It contained a script that modified the PHP runtime and also an output file that indicated that the script was run.
I contacted Microsoft Azure Support and they acknowledged that the problem was due to a change they made. Fortunately, since PHP support is still in preview, they do consider the problem a regression and they will work on a solution.
Until then they provide a temporary workaround:
Follow instructions here from
https://github.com/Azure/azure-functions-host/wiki/Using-a-custom-version-of-Python
and copy
https://windows.php.net/downloads/releases/php-7.2.7-Win32-VC15-x64.zip
instead of python to site\tools.
This workaround does reset the php.ini config to the default so you might want to change a few things in the php.ini:
cd D:\home\site\tools
cp php.ini-production php.ini
And then make the desired changes to the php.ini file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With