question

DavidFenske-4791 avatar image
0 Votes"
DavidFenske-4791 asked MatMarlow-1312 commented

Enabling pHp extensions on Azure Windows app service

Hi Azure community,
Can you help me figure out what I'm missing? I've followed instructions from the Azure docs on enabling pHp extensions in order to try and add outgoing FTP to my WordPress site. I've been following directions here:
This app service was set up using the WordPress template offered by Azure.
I've completed the following:
1. Created a new directory using Kudu - /home/site/ini
2. Added an App Setting PHP_INI_SCAN_DIR with a value of "/usr/local/etc/php/conf.d:/home/site/ini"
3. Verified the existence of the installed pHp extension as php_ftp.dll
4. Add a file "extensions.ini" into the new /home/site/ini directory shown above, and entered the line extension=php_ftp.dll
5. Restarted the app service

My phpinfo.php file still doesn't show it picking up the additional configuration file. Any ideas?

Thank you!!
David


azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DavidFenske-4791 avatar image
1 Vote"
DavidFenske-4791 answered MatMarlow-1312 commented

OK, I finally got this to work. The combination of settings that proved effective were:

I changed the PHP_INI_SCAN_DIR from the recommended combination of two paths as shown in my original post to simply "C:\home\site\ini". The first time I tried this, the site wouldn't reload, but this time it worked. This was confusing as some docs showed a web path with forward slashes and some a drive path with drive letter and backslashes. Perhaps some of the docs were for Linux on Azure instead of Windows.

I also created a copy of the DLL file in a /bin directory under wwwroot, as suggested in the Azure docs. Other docs have said that since it was already included in the installed PHP libraries (which I confirmed) that wouldn't be necessary. However this did work.

I set the extension setting to an absolute path instead of just naming the extension: extension=/home/site/wwwroot/bin/php_ftp.dll (not a drive path here, oddly)

Anyway, it finally kicked in.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The reason for the different path formats is that the Azure docs show guidelines for both Linux (forward slash) and Windows (drive letter, backslash). There's a toggle at the top of the page to choose between them and if you google something, you could end up at either page.

1 Vote 1 ·

Hi David,

Thanks for sharing the solution that worked for you. I am sure that others in the community who may face a similar issue will find your solution helpful.

-Grace

0 Votes 0 ·