Home > Archive > PHP SQL > January 2005 > Apache won't load php_mysql.dll
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Apache won't load php_mysql.dll
|
|
| no@emails.thx 2005-01-23, 8:57 pm |
| Hi
I have installed apache 2.x on a Win2k machine ... followed by PHP5
(into C:\php). The PHP is installed OK and i can run simple PHP pages.
I installed MySQL and put down a database backup - no problems -
queries work fine in Query Browser.
But when I tried to use MySQL through PEAR DB it said "DB Error:
extension not found". So i have tried to install mysql support in php5
in php.ini. I took out the ; from the extension=php_mysql.dll line and
checked my extension_dir value was correct. But when i restart Apache
it just says: "PHP Startup: Unable to load dynamic library
'./php_mysql.dll' - The specified module could not be found" (the
exact messge varies according to the extension_dir setting in php.ini)
I have tried every permutation of the extension_dir that i can think
of - with / or \ ... or specifiying C:/php/ext or C:/php and copying
the php_mysql.dll file everywhere - like all through the PHP folder
tree - and even WINNT\System32 ... but still no joy.
Anybody got any ideas? :-/
Thanks
Chris R.
| |
| Andy Hassall 2005-01-23, 8:57 pm |
| On Sun, 23 Jan 2005 11:19:03 GMT, no@emails.thx wrote:
>I have installed apache 2.x on a Win2k machine ... followed by PHP5
>(into C:\php). The PHP is installed OK and i can run simple PHP pages.
>I installed MySQL and put down a database backup - no problems -
>queries work fine in Query Browser.
>
>But when I tried to use MySQL through PEAR DB it said "DB Error:
>extension not found". So i have tried to install mysql support in php5
>in php.ini. I took out the ; from the extension=php_mysql.dll line and
>checked my extension_dir value was correct. But when i restart Apache
>it just says: "PHP Startup: Unable to load dynamic library
>'./php_mysql.dll' - The specified module could not be found" (the
>exact messge varies according to the extension_dir setting in php.ini)
>
>I have tried every permutation of the extension_dir that i can think
>of - with / or \ ... or specifiying C:/php/ext or C:/php and copying
>the php_mysql.dll file everywhere - like all through the PHP folder
>tree - and even WINNT\System32 ... but still no joy.
>
>Anybody got any ideas? :-/
Add c:\php to your PATH environment variable.
php_mysql.dll requires libmysql.dll, which in PHP5 is bundled in the php
directory, assuming you have installed from the .zip download of PHP. Unless
it's visible through a directory in the PATH environment variable, it'll fail
with the error message you stated - because php_mysql.dll will try and fail to
load the library when PHP tries to load php_mysql.dll.
The other less recommended alternative is to put libmysql.dll in the system32
directory, but you're better off not messing with the system directories; it's
likely to sting you later.
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
| |
| no@emails.thx 2005-01-23, 8:57 pm |
| On Sun, 23 Jan 2005 11:32:02 +0000, Andy Hassall <andy@andyh.co.uk>
wrote:
> Add c:\php to your PATH environment variable.
>
> php_mysql.dll requires libmysql.dll, which in PHP5 is bundled in the php
>directory, assuming you have installed from the .zip download of PHP. Unless
>it's visible through a directory in the PATH environment variable, it'll fail
>with the error message you stated - because php_mysql.dll will try and fail to
>load the library when PHP tries to load php_mysql.dll.
>
> The other less recommended alternative is to put libmysql.dll in the system32
>directory, but you're better off not messing with the system directories; it's
>likely to sting you later.
That's great - thanks Andy, you're right - i hadn't modified the PATH
variable so that would be it ... initially i just took the advice of
someone else here and copied libmysql.dll to system32 (which got it
working) but your solution is more secure and easier to maintain.
Thanks again
Chris R.
|
|
|
|
|