Jump to content


Photo

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


  • Please log in to reply
3 replies to this topic

#1 gringo guy

gringo guy

    Newbie

  • Member
  • Pip
  • 3 posts
  • Main OS: Windows XP

Posted 04 August 2010 - 02:10 PM

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,

#2 gringo guy

gringo guy

    Newbie

  • Member
  • Pip
  • 3 posts
  • Main OS: Windows XP

Posted 04 August 2010 - 05:37 PM

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

putenv("PATH=C:\WINDOWS\system32;C:\WINDOWS");

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,

#3 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 05 August 2010 - 11:40 AM

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:

putenv("PATH=C:\WINDOWS\system32;C:\WINDOWS");

“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 :)

#4 gringo guy

gringo guy

    Newbie

  • Member
  • Pip
  • 3 posts
  • Main OS: Windows XP

Posted 07 August 2010 - 09:38 AM

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.
Cheers,

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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users