0

Trying to load one new extension to php instance on Azure. After reading several articles and tutorials, I feel that I have everything set up properly. In addition to adding the dll, I'm also telling the file to change the location of the includes/ directory. In addition, I've tried both PHP7.2 and 7.3 for the application.

That change works, so the file is getting read. But teh .dll does not show up with phpinfo nor a dump of all the loaded extensions. The fact that the .ini file I'm using also specifies a new location for the includes directory show that the file is being read properly. That does not hold true for the dll though and I don't know it I'm using the wrong version of the dll, have a poor configuration or something else.

This is my first rodeo with Azure, so it's a steep learning curve so far.

I've tried multiple variations of the details but nothing has worked yet. Currently, I have an application setting with "PHP_INI_SCAN_DIR" that points to the directory in the D drive of d:\home\site\ext.

I have another .ini file for the actual extensions in the ini directory as well. The sole line in it points at the dll location - zend_extension="d:\home\sites\ext\php_xdebug-2.7.2-7.2-vc15-nts.dll"

The path is correct and, from what I can tell, everything is right - but the extension won't load. I've changed the location, changed the file name, changed build versions of the file, used 'zend_extension' and just plain 'extension' with similar results. Using 32bit nts extensions as well.

No error messages seen - either on screen on in the logs on Azure. I expect to see xdebug as a separate section after wddx using phpinfo() but nothing shows.

Any assistance would be greatly appreciated. Thanks in advance.

1 Answer 1

1

It sounds like you have read the related sections of the offical document Configure PHP in Azure App Service.

However, there are some important points I think which be necessary to pay attention to.

  1. In section How to: Change the built-in PHP configurations, notice for these steps as below.]
  • Add a .user.ini file to your root directory.

  • Add configuration settings to the .user.ini file using the same syntax you would use in a php.ini file.

  • Restart the app. (Restarting is necessary because the frequency with which PHP reads .user.ini files is governed by the user_ini.cache_ttl setting, which is a system level setting and is 300 seconds (5 minutes) by default. Restarting the app forces PHP to read the new settings in the .user.ini file.)

  • Add an App Setting to your app with the key PHP_INI_SCAN_DIR and value d:\home\site\ini

  • Create an settings.ini file using Kudu Console (http://.scm.azurewebsite.net) in the d:\home\site\ini directory.

  • Add configuration settings to the settings.ini file using the same syntax you would use in a php.ini file.

  • To reload the changes, restart your app.

So it's important that to create .user.ini and settings.ini files in the correct path, and to restart your app is required for reloading the changes.

  1. In sections How to: Enable extensions in the default PHP runtime and How to: Use a custom PHP runtime, for compatibility, please use an extension with VC9 and non-thread-safe (nts) compatible version, not VC15.
  • Put .dll extension files in the ext directory (for example, php_xdebug.dll). Make sure that the extensions are compatible with default version of PHP and are VC9 and non-thread-safe (nts) compatible.

  • Obtain a non-thread-safe, VC9 or VC11 compatible version of PHP for Windows. Recent releases of PHP for Windows can be found here: https://windows.php.net/download/. Older releases can be found in the archive here: https://windows.php.net/downloads/releases/archives/.

Hope it helps.

Sign up to request clarification or add additional context in comments.

1 Comment

I'll have to try the user.ini file, so I'll give that a try - though from the explanation above it sounds as pretty much the same thing as the settings.ini file.What I don't understand is if Azure is installing php 7.2 or 7.3, both are VC15.Why do they limit additional extensions to old versions, just to get the VC9 or 11 versions? That doesn't make any sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.