Re: [PHP-DEV] Are PECL modules preferable?

This is only part of a thread. view whole thread
  109276
March 24, 2020 15:11 thruska@cubiclesoft.com (Thomas Hruska)
On 3/23/2020 3:53 PM, Johannes Schlüter wrote:
> For Windows pecl produces builds where we can, while users have to > install by hand.
Yeah, I've noticed this and thought about building a tool to help automate installation. However, it would be much easier to use PECL extensions on Windows if PHP on Windows actually had a simple way to add all the DLLs in a PECL extension to *just* the 'ext' directory and not have to copy multiple DLLs all over the place. For example, imagick has a ton of imported DLLs that are referenced by the main extension DLL, which fails to load for a lot of people. Then they have to go searching Google to figure out how to fix it for each separate SAPI. I'm thinking the problem is something that can be remedied with SetDllDirectory(): https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setdlldirectorya Or AddDllDirectory(): https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-adddlldirectory Depending on if WinXP support is still a thing and/or having multiple directories is even possible. Calling LoadLibraryEx() looks like it would be a pain to implement given that the only references in the entire code to "LoadLibrary" is pushed all the way back into m4/configure? As PHP parses the 'extension_dir' INI option, it could call the relevant function above to allow for loading additional DLLs from the same directory when loading extensions. Doing that would fix so many Windows loader related issues that people have with getting the precompiled PECL extensions to work on Windows (especially with mixed SAPI environments). -- Thomas Hruska CubicleSoft President I've got great, time saving software that you will find useful. http://cubiclesoft.com/ And once you find my software useful: http://cubiclesoft.com/donate/