MySQL not working on PHP 5.2.4 zip based install

MySQL not working on PHP 5.2.4 zip based install

am 02.10.2007 19:43:17 von Cool Dude

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

am 02.10.2007 20:43:03 von Macca

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
one).

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.


Regards,

Paul

Re: MySQL not working on PHP 5.2.4 zip based install

am 30.10.2007 22:32:31 von Cool Dude

On Oct 2, 11:43 pm, macca wrote:
> 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
> one).
>
> 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.
>
> Regards,
>
> Paul

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

am 30.10.2007 23:15:33 von luiheidsgoeroe

On Tue, 30 Oct 2007 22:32:31 +0100, Cool Dude
wrote:

> On Oct 2, 11:43 pm, macca wrote:
>> 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
>> one).
>>
>> 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.
>>
>> Regards,
>>
>> Paul
>
> 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.
>

The manual told you too, explicitly:

http://nl2.php.net.mysql:
"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

am 30.10.2007 23:29:31 von AnrDaemon

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

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

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"


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)


--
Sincerely Yours, AnrDaemon