Jump to content
The Uniform Server Community

Unable to load dynamic library (php_mysql & sqli.dll)

gringo guy

Recommended Posts

New to the uniform server, and am having trouble getting started. In the Apache log file I get eight of the following errors, 4 each for php_mysql.dll and php_mysqli.dll.


PHP Warning: PHP Startup: Unable to load dynamic library 'C:/opt/wamp/UniServ568a/usr/local/php/extensions\\php_mysql.dll' - The specified procedure could not be found.\r\n in Unknown on line 0


Googling for this shows some ancient notes (about dll versions, and setting the Windows PATH EV and rebooting) but that doesn't seem right for a portable app that's as well integrated as this one, does it? Searching this forum I find a couple of old posts that don't solve the problem either.


I've checked the basics: no spaces in path names, extensions_dir in php.ini looks ok. BTW, I already have another Apache server running on this WinXP PC so, before first start up, I do run the move_servers script using the default values--I tried both with and without the accelerator option.

Wtf? Thx,

Link to comment
Share on other sites

No worries, got it. Thanx anyway. Turns out that *someone* had earlier installed PHP and I, um, someone, updated the system path. So when Uniform Server started Apache it found php5ts.dll under /Program Files/PHP instead. Even tho same version of PHP, different dlls (I guess that's good, otherwise this would have been non-obvious).


A fix was simple enough: modified the start_apache() function (in unicon/main/includes/functions.php) to set a sanitized PATH just before it exec's Apache.exe




Is there any reason this should not be the default action for Uniform Server startup? Some would consider inheriting a random PATH when starting a Web server to be a security hole. At least could this be made into a configurable option? That would be excellent.


Either way, thanks so much for this bundle of goodies. This is quite an amazing set of tools.

Solo mi dos colones,

Link to comment
Share on other sites

What an excellent post! You ask a question and then post a solution.


This type of issue I thought had long been resolved, apparently not. It was easily reproducible.


Your solution works perfectly:




“Is there any reason this should not be the default action for Uniform Server startup?”


No reason whatsoever however I will implement a slightly different solution:

After reverting back to your original configuration try the following:


Edit file UniServer\usr\local\apache2\conf\httpd.conf


Locate this section:

Loadfile "C:/Nano_5_6_8/UniServer/usr/local/php/ssleay32.dll"

Loadfile "C:/Nano_5_6_8/UniServer/usr/local/php/libeay32.dll"

Loadfile "C:/Nano_5_6_8/UniServer/usr/local/php/libmysql.dll"

And add this line:

Loadfile "C:/Nano_5_6_8/UniServer/usr/local/php/php5ts.dll"

Note: Your paths will be different


Above lines force Apache to load dll’s from a specific location.

Advantage Apache does not need to search along any paths.


“Some would consider inheriting a random PATH when starting a Web server to be a security hole”


Environment variables exposed by the server are a secure sub-set of those exposed to the CLI interface hence not a security issue.


All the best

Ric :)

Link to comment
Share on other sites

Hey Ric, Thanks for your quick response, and glad you liked the post :) I will definitely add the line to httpd.conf, but I'm going back and forth about leaving the path setting. Seems to me it would keep similar problems from occurring in the future.


You have obviously gone to a lot of effort to allow all of this to be easily portable. I'm trying to think of a scenario where I'd want to inherit a path vs. having it set to a known quantity. Back in the day, one of the first things I changed during an Apache install on *nix was to set a short path EV in the apachectl script.



p.d. I didn't realize that EVs on Windoze varied depending on context. That's interesting; thanks for the tip.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...