Question

The extension I'm writing is a wrapper for a specific library. On Linux my extension working excellent via cli both apache, but on Windows it's working only in cli. Apache gives me an error:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\eps_api.dll' - The specified module could not be found.\r\n in Unknown on line 0

I'm sure the specified dll is there.

When I compile the simple extension without any external dependencies, it works, but when I use functions from external dll, it fails. The external dll is in the PATH, and I'll say it again, php-cli works good.

Then I tried to use LoadLibrary() function in RINIT, but it also fails with error 126 (module could not be found) in apache and works in cli.

My extension is compiled with MSVC9, and external library with MinGW 4.6.2, and I guess that is the trouble. .a export table is converted to .lib with CMake function GNUtoMS. Apache version 2.2.26, Windows XP SP3.

Any ideas how to make it work? Configs, logs or technical information on your requests.

P.S. Sorry for my bad English.

Edit: I wrote test script, printing PATH variable, and result returned by apache is rather different from that one given from cmd. So the question is how to change PATH in apache? I searched registry for entries, tried to use SetEnv directive in httpd.conf, but without result.

Edit 2: Problem solved with rebooting virtual machine and updating system path.

Était-ce utile?

La solution

On Windows, that particular error message can mean a dependency of the specified module is not found. Grab "depends.exe" and ensure Apache's PATH has all the required transitive dependencies.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top