Click to See Complete Forum and Search --> : loading dynamic library


reeksy
12-10-2005, 12:25 PM
Hi

Ive been working with PHP 5 and Mysql for around 3 months now with no problems.

However for some reason i get this error when i start up my PC:

----------------------------
Warning

PHP Startup: Unable to load dynamic library './ext/php_mysql.dll' - The specified procedure could not be found
----------------------------

The extensions im trying to load (so i can re-connect to mysql!) are:
extension=php_msql.dll
extension=php_mysql.dll


I know you have to change the extension_dir =" " in the php.ini but im unsure on what to change it to.

Ive tried all of the following and i still get the 'unable to load error'

extension_dir = "C:\php5\ext\"
extension_dir = ".\"
extension_dir = ".\ext"
extension_dir = ".\C:\php5\ext"

All my extensions are in C:\php5\ext\

Norman Graham
12-10-2005, 12:46 PM
Hi Reeksy

Could this be a forward slash / backward slash problem? The error message shows forward slashes, as one might expect from a piece of software intended for *nix, but your directory values use backward slashes because you're using Win32.

I'm on a dual-boot machine here, but I do have WAMP running (Apache 2.x and PHP4) on my WinXP partition. I'm in Linux right now and don't really want to re-boot to Win to check my httpd.conf file. If you can't solve the issue, however, I'll have a look.

I switched to LAMP in the spring of this year so my knowledge of WAMP is a little foggy.

Norm

reeksy
12-10-2005, 01:34 PM
Hi Norman

Thanks for the reply, ive tried both forward and back slashes but neither seem to work!

I thought that by default the extension_dir's "./" in the php.ini file would load the extension module as when i first set up my WAMP i dont remember changing the 'extension_dir'

The error started after i installed a piece of software then enabled network play - im not entirely sure that this caused the error but its possible. Ive uninstalled this since but to no joy!

Any more ideas!?!

Thanks,

Jon.

Norman Graham
12-10-2005, 03:03 PM
Hi Reeksy

Right, I'm on WinXP now and I've had a look at my php.ini. Please bear in mind that my WAMP uses PHP4 and not 5. I don't have any extension_dir statements. The INI file says that MySQL support is built into PHP4 and that specifying the DLL is not necessary.

This may be different in PHP5. Not sure because I compiled PHP5 on Linux and that's a whole different kind of procedure. You add the mysql enabled flag in the compilation and that's it done.

I'm not helping you much here.

Norm

reeksy
12-11-2005, 09:34 AM
Hi again

Mysql is not automatically enabled in PHP 5 which makes this a bit awkward!

Could it be something to do with Apache? I don’t really want to go re-installing Apache if i can avoid it

Cheers.

Jon

Norman Graham
12-11-2005, 06:09 PM
Hi Reeksy

No, Apache has nothing to do with it. You need to enable PHP in Apache, i.e. add it in as a module. Apache doesn't communicate with MySQL however - PHP does that.

Are you running NTFS? Could it be that for some reason your read/write permissions have been changed? That might explain why the setup worked before but doesn't now. Other possibility: you've somehow disabled the MySQL server as a service and now have to start it manually in a DOS box before you can use it

I'm a bit confused as to why you want to load both msql and mysql. You can't run both of them simultaneously, at least not as far as I know.

Have you had a look at the installation directives for PHP5 on Win32 in the manual? It says that your installation has to run under c:\php (and not php5) - or rather, you don't have to do that, but that's the default.

I'm clutching at straws here. Last straw: you haven't perchance mistyped the host/user/password combination?

Norm

reeksy
12-12-2005, 09:04 AM
Hi

Sorry my mistake i do only want to load msql!

I am running NTFS. Its possible that the permissions have changed - would this be on the folder or on the actual dll's?

If i have disabled the MySQL server as a service how would i load it automatically again? Or if this is not possible - how do i start it in DOS?

As far as installing PHP 5 goes i was unaware that it had to be installed under 'php' rather than anything else. I followed the installation instructions from a book and it advised to install php under 'php5' !

I dont think this would cause a problem as my WAMP has been working fine for sometime now!

Im not at home at the moment but when i get back ill try what you’ve suggested!

Incidentally I reinstalled MySQL, Apache and PHP yesterday out of frustration but I still got the same error!

Thanks. Jon

reeksy
12-13-2005, 03:38 PM
Hi again

Ive tried all of what you have suggested but im still not having any luck! (Permissions and services all OK)

I know for a fact that i can load extrensions as ive un-commeneted most of the extensions in my ini file as i dont get any errors. It's just the MYSQL extensions that i get errors with!

Im not sure if this helps as to where the error could be?

Anyone got any ideas!?!

Jon.

Norman Graham
12-14-2005, 04:12 AM
Hi Jon

It depends which version of MySQL you have installed and on which Win32 version. I used to have it on Win98 which doesn't run stuff as a service, so I started it from a DOS-box every time. I now have it on WinXP and it is installed as a service by default. I can still stop it and restart it from the command line, but it starts itself every time I boot my Windows partition.

Look, try this link (http://dev.mysql.com/doc/refman/5.0/en/windows-start-service.html) to the manual page about using MySQL as a service on WinNT/2K/XP. The commands you need to check your installation are listed there.

HTH

Norm

bpat1434
12-14-2005, 11:15 AM
Here is my line for loading any DLLs:

extension_dir = "c:\php\ext"

Try a lowercase "c". Also, make sure that your paths in Windows are setup properly.

~Brett

reeksy
12-15-2005, 05:25 PM
Hi bpat1434

I have set my extension_dir = "c:\php\ext"

How do i make sure that my paths in Windows are setup properly?

Thanks

bpat1434
12-15-2005, 05:55 PM
Start-->(Right Click) My Computer--> Properties

Advanced --> Environment Variables

~Brett

reeksy
12-17-2005, 01:15 PM
Hi again!

Ive tried and tested everything and all seems to be OK!

Where abouts to you set up the username and password for MySQL? Could this be it? I think its my last shot!

reeksy
12-18-2005, 09:23 AM
GET IN!!!

Ive sorted it!

All it was is my libmysql.dll file had either been corrupted or overwritten in the C:\WINDOWS\system32\ directory.

To fix it i reinstalled PHP and copied the (libmysql.dll) file back into the Windows system32 directory - overwriting the old one.

Thanks for your help Norman Graham and bpat1434.

Happy days........