MySQL not working on PHP 5.2.4 zip based install

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I installed PHP 5.2.4 on Apache 2.2.6 with MySQL 6.0.2 alpha on
Windows XP Professional Service Pack 2 and everything is working fine
but the MySQL extension for PHP. The error log in Apache says:

PHP Warning:  PHP Startup: Unable to load dynamic library 'H:\
\php-5.2.4-Win32\ext\php_mysql.dll' - Invalid access to memory
location.\r\n in Unknown on line 0

Why does this happen? And, how can I cure this?
Please reply at the earliest. Thanks in advance.

Re: MySQL not working on PHP 5.2.4 zip based install

This usually happens due to an old version of php_mysql.dll on your
system somewhere.

When this bit me it was because i had a copy of php_mysql.dll in my
apache folder, even though i had configured php.ini to read it from
the new php directory.

Search your system (e.g. start->search) for "php_mysql.dll" and delete
them all except for the one in the php/ext directory (the up-to-date

Make sure you have a copy of php_mysql.dll in the php/ext directory
and php.ini has the correct path to your php/ext directory.



Re: MySQL not working on PHP 5.2.4 zip based install

Quoted text here. Click to load it

Thanks Paul/macca. Although I have seen this reply after a long time,
I guess it will be helpful when I do a fresh install of WAMP some
other time. My problem was solved by copying the "libmysql.dll" file
inside the "php\." directory to the "windows\system32\" Someone on IRC
told me to do that.

Re: MySQL not working on PHP 5.2.4 zip based install


Quoted text here. Click to load it

The manual told you too, explicitly: :
"Installation on Windows Systems
PHP 5+
...A file named libmysql.dll is included in the Windows PHP distribution  
and in order for PHP to talk to MySQL this file needs to be available to  
the Windows systems PATH. See the FAQ titled "How do I add my PHP  
directory to the PATH on Windows" for information on how to do this..."

Rik Wasmus

Re: MySQL not working on PHP 5.2.4 zip based install

Greetings, Cool Dude.
In reply to Your message dated Wednesday, October 31, 2007, 00:32:31,

Quoted text here. Click to load it

That was a bad solution.
Right one is to preload library before loading PHP extension.
Following example is from my live Apache installation:

LoadFile C:/usr/sbin/php-5.2.2-Win32/libeay32.dll
LoadFile C:/usr/sbin/php-5.2.2-Win32/ssleay32.dll

LoadFile C:/usr/sbin/mysql/bin/libmySQL.dll

LoadFile C:/usr/sbin/php-5.2.2-Win32/php5ts.dll

LoadModule php5_module "C:/usr/sbin/php-5.2.2-Win32/php5apache2_2_filter.dll"

<IfModule php5_module>
  php_admin_value extension_dir "C:/usr/sbin/php-5.2.2-Win32/ext"
  PHPIniDir "C:/usr/sbin/php-5.2.2-Win32"

Notice that I use libMySQL shipped with MySQL server rather than one bundled
with PHP. I've recently discovered problem in bundled libMySQL.dll slowing
down server and cause high system load. Details on bugtracker, if You want
more info.

Other solution is to use Connector/PHP from MySQL website. (One for
PHP5/MySQL5, I've got twice increase in server responsivity from time I
change connector from bundled with PHP 5.2.4 to one suppied by MySQL)


Site Timeline