i just finished upgrading my php to php5 because i wanted to see the changes, but now my code doesnt do anything at all. like the one to connect to a database. it just gives me a blank white screen so when i went to check phpmyadmin to see if it was even submitting anything i got this error.'


"cannot load MySQL extension, please check PHP Configuration"

im pretty sure that i have installed PHP right. Does php my admin just not work with it, or is there somthing i need to do with mySQL to get it to work with php5. Thanks in advanced for any help that anyone has to offer.

To add to that, heres what happend after i followed the directions to the FRIGGIN T!!!!

i even add the line extension=php_mysql.dll the php.ini file. and when i start i get this error (when i start apache that is)

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

even though if you navigate there on my harddrive its there?? ugh!!

You do know that PHP5 doesn't have MySQL installed like PHP4 right?

PHP5 has SQLite because of licesne differences or something, however you can install it.

well i was able to get most of it figured out. I had to rebuild the structure of the files in PHP5 then i had to move a few files around and add a few lines to the php.ini file to get php_mysql.dll to work again.

Killer_Typo, can you please share your findings in more detail 'cause I'm having the same problem. Thanks!

i honestly dont remember what i did now. but since php5 is now out of alpha and up for release it should be good to install now.

Here's how i solve the prob :

php.ini
extension_dir = "c:\php"

copy php_mysql.dll from c:\php\ext to c:\php
copy libmysql.dll and php_mysql.dll from c:\php to %Systemroot%\system and %Systemroot%\system32

Restart Apache2

Few of thoses steps are facultative but that's what i did.

Enjoy!

Hi,
Had same problem.

Same as above:
copy libmysql.dll
to windows system root system/ and system32/

I left my extention module path to be
php root ext/

though

That should mess with the activation of other modules then.

:)

Here's how i solve the prob :

php.ini
extension_dir = "c:\php"

copy php_mysql.dll from c:\php\ext to c:\php
copy libmysql.dll and php_mysql.dll from c:\php to %Systemroot%\system and %Systemroot%\system32

Restart Apache2

Few of thoses steps are facultative but that's what i did.

Enjoy!

Thanks for the replies. I'm really not sure why this 'still' isn't working. I have the dll files in the php\ext, php\, system\, AND system32\ folders. I have an environmental path to c:\php. It doesn't matter if I change the extension_dir to c:\php or leave it c:\php\ext. This is all I get with the latest version of phpMyAdmin.

cannot load mysql extension,
please check PHP Configuration
Documentation

I'd also like to mention that this was working 100% with php4. Any other suggestions 'cause, frankly, I'm a bit stumped on this??

I'm an idiot. PHP5 does not have MySQL enabled by default so the ;extension=php_mysql.dll in the php.ini file needs to be uncommented. Duh! :o

Thanks, everyone, for the assistance.

hi, i recently had the same issue as u guys and after using your solutions i now have another problem.

i am running php 5.0.2, apache 2.0.52 on windows XP SP2.

whenever i try to parse .php files from my server the apache server crashes (Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience.) . if i comma out (disable) mysql entension in php.ini from loading then that fixes the crash but now i cant use mySQL.

any sugestion would be appreciated.. thanks allot

ok the problem was the wrong libmysql.dll files.. so what i did was copied the original from the php .zip and places them info to system and system32 folders along with the ext and php root..

I installed php 4 ages ago and never had any problems using MYSQL. I am running windows 2000 and mysql 4.22 with apache 2. This is what I did - I downloaded the windows installer.exe for PHP5 from www.php.net. I installed it but it didn't have any of the extensions for mysql.

All you need to do to sort this out is:

1. go into your mysql\bin folder and copy libmySQL.dll into your winnt\system & winnt\system32

2. Download php-5.0.3-Win32.zip from www.php.net (this has all the extensions 'php_mysql.dll')

3. Copy the php_mysql.dll into your php folder

4. Go into the php.ini file in your winnt folder and uncomment extension=php_mysql.dll (make sure your extension_dir in php.ini is pointing to where you put these .dll files).

Hope this helps!!

OK I love you guys <3 i got the problem fixed! am using:

phpMyAdmin 2.6.1-rc2
With PHP5 and when i log into mysql it gives me this error on the bottom.

The mbstring PHP extension was not found and you seem to be using multibyte charset. Without mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.

When you installed PHP5 did you follow the steps I left in the previous message? What platform are you running PHP5 on?

Am running
Windows Server 2003 Enterprise Edition

Am running
Windows Server 2003 Enterprise Edition
Service Pack 1, v.1280

Computer info
Intel(R) Pentium(R) 4 CPU
2.66GHz
2.66 GHz, 504 MB of Ram

Running IIS6
PPHP Version 5.0.3
and asp

Am currently trying to install mysql 4.1.8 with the win install but am having that issue.

Mysql is working but it just gives me that error on phpMyAdmin

OK I love you guys <3 i got the problem fixed! am using:

phpMyAdmin 2.6.1-rc2
With PHP5 and when i log into mysql it gives me this error on the bottom.

The mbstring PHP extension was not found and you seem to be using multibyte charset. Without mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.

Check your php.ini if you have this line "extension=php_mbstring.dll" uncommented, it must be! ;)

I was getting the same message,

cannot load MySQL extension,
please check PHP Configuration.

while trying PHP 5.0.2 with mysql on apache 1.3.x.

The following steps works as solution to this problem:

1) in php.ini modify line
extension_dir="./"
to
extension = "c:/php/ext/"

2) uncomment the line
;extension=php_mysql.dll
in php.ini by removing the ';' from the beginning.

3)copy libmysql.dll from c:\php to c:\windows

Then run apache server again.

If you have any problem you can ask me at piyush_aggarwal79@yahoo.com

bye, thank you.

Guys I have tried absolutely everything to get this to work and I'm still having the mysql extension problem. I have all of the .dll files in the right places, my php.ini file has all the right lines uncommented and I still get the error:
cannot load mysql extension,
please check PHP Configuration
Documentation

Maybe my folders aren't placed right - I have:
C:\PHP
C:\phpmyadmin
C:\mysql
Can somebody tell me what they have, is there a specific hierarchy I'm supposed to put them in?
Thanks.

Maybe my folders aren't placed right - I have:
C:\PHP
C:\phpmyadmin
C:\mysql
Can somebody tell me what they have, is there a specific hierarchy I'm supposed to put them in?
Thanks.

Trinity, phpMyAdmin is run through a browser, so you have to put it someplace your web server can get to it (ie. c:\apache\htdocs\phpMyAdmin\)

Try sticking it in your htdocs folder and browsing to http://localhost/phpMyAdmin/

Hope that helps.

For those who tried all the above, but still have no succes:

Open httpd.conf (the Apache configuration file) in a text editor and add the following line:

PHPIniDir "C:/php"

Replace 'C:/php' with the path to the directory where your php.ini file is residing.

Save the file and restart Apache.

This did the trick for me.

What gave me some headache was the fact that I needed to add to all paths a trailing slash in contrary to the examples! I needed that for PHPIniDir in the Apache httpd.conf files as well as in the php.ini file with the extension_dir.

Once I added the trailing slash, the installation worked for me.

Andreas

I am having same problem, just want to try your last advice. My question is where do you put this line in apache2 httpd.conf.

Much appreciated. Thanks.

For those who tried all the above, but still have no succes:

Open httpd.conf (the Apache configuration file) in a text editor and add the following line:

PHPIniDir "C:/php"

Replace 'C:/php' with the path to the directory where your php.ini file is residing.

Save the file and restart Apache.

This did the trick for me.

I added the line starting with PHPIniDir after my last line of LoadModule, which was the one that is loadeing the php5_module.

Hope that helps.

Andreas

wow! after spending days on it the last advice on entering
PHPIniDir "C:/php" seem to have done the trick. I can finally see the username/password screen and then see phpmyadmin index page. Thank you.

k guys you don't need to move anything around and what not, just download the full zip which has the extensions for mysql from php.net, then download the windows installer and let it overwrite and configure it's shite, don't keep your exisiting php.ini file, but rather find the new one and simply replace ';extension=php_mysql.dll' with 'extension=ext/php_mysql.dll' dropping the ; and adding the ext to get to php_msql.dll in the ext folder for php 5. Baaaaazing :eek:

hi all ..
Just wanna ask what is the different with uncommented and commented.

What is just did for the configuration is just as displayed in this site
http://www.devside.net/web/server/windows/phpmyadmin

But what you hve to do is beware of the uncommented extension althought i not so sure what is that .. (uncommented == removing the ; )

Then everything is resolve..

hope you guys can tell me what is it ..

regards,
Billy

thanks again guys .

Just wanna ask what is the different with uncommented and commented.

The difference between an uncommented and commented line is that one is commented and the other is not! :eek: A "commented" line will be ignored by the processor -- comments only exist for the human reader. In many configuration files, lines that you can optionally enable will be commented out. This makes it easy for you to enable the line by simply removing the comment character at the beginning of the line.

The php.ini file contains several lines that reference extensions that you can optionally enable or disable to fit your requirements. On Windows, these extensions are DLL files (Dynamic Link Libraries). On Linux, they are .so files. In either case, when Apache is started, and it loads PHP as a module, it checks the php.ini file to see which extensions to also load. For example, if you want to work with a MySQL database, you need to enable (uncomment) the mysql.dll extension line. For phpMyAdmin, you'll also want to enable the mbstring.dll extension.

Oh i see .. thanks man .. no wonder we should do the same with PHP when we have to remove the (#) from the module part inorder for us to use the module ...

Thanks man .. that really do help ..

regards,
Billy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.