Solved

Windows PHP5 MySQL installation problems

Posted on 2004-07-30
8
48,637 Views
Last Modified: 2013-12-13
Hi folks -  

I'm having a terrible time getting mysql support up for php5 on my devlopment machine.  I'm new to the php environment, and I'm obviously missing something, hopefully something obvious to those more experienced!  Is there some other library I need besides php_mysql and libmysql maybe?

Versions:
php5 (just downloaded)
mysql 4.0.20a-nt  (as reported by c:/php/bin/mysql)
WinXP Pro
IIS

PHP.ini contains:
extension_dir = "c:/php/ext/"
extension=php_mysql.dll

File Locations:
php_mysql.dll is in c:/php/ext/
libmySQL.dll is in c:/windows/system32/

My simple test code:
<?
echo '<br> php running';
$dbcnx = mysql_connect('localhost');
echo '<br> connection ran OK';
?>


Results:
Warning: PHP Startup: Unable to load dynamic library 'c:/php/ext/php_mysql.dll' - The specified procedure could not be found. in Unknown on line 0
Content-type: text/html X-Powered-By: PHP/5.0.0
php running
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\CAFGPHP\test.php on line 4
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/php/ext/php_mysql.dll' - The specified procedure could not be found. in Unknown on line 0

Thanks so much for your help.
0
Comment
Question by:savageanne
8 Comments
 
LVL 1

Expert Comment

by:it-guy
ID: 11679568
Hi savageanne,
Did you add the line "extension=php_mysql.dll" on your own?
I am running an identical setup to you, but I don't have a mysql extension loading into the php.ini file.

If you added it on your own, take it out and try restarting the web service.
0
 
LVL 2

Expert Comment

by:japly53
ID: 11686875
I'm a beginner too, and if you are installing php on your computer. You should get XAMMP, it install everything you need (apache, PHP, mysql, php,etc) Very easy installation, next,next,next, your done!
http://www.apachefriends.org/en/xampp.html

Once you have it installed, you just start the server by clicking on a file.  The you can access your own server by typing http://localhost.  

I also use a php editor called DzSoft PHP Editor:
http://www.dzsoft.com/

I hope this helps.
0
 

Author Comment

by:savageanne
ID: 11690355
Hi folks -

Thanks for your help.  I did solve the problem.  Turns out there were two different copies of libmysql.dll on my machine.  

One was 244 KB dated 5/29/04 and was in the mysql\opt directory.
The other was 228 KB dated 7/13/04 and was in the php\ext directory.  

The 244 KB one was the one I had copied into my system32 directory and that didn't work at all.  Once I copied the correct version from php\ext to system32 all was well.  

Thanks for your suggestions in any case.

- Anne
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Accepted Solution

by:
OzzMod earned 0 total points
ID: 11734792
Closed, 125 points refunded.
Thanks

OzzMod
Community Support Moderator
0
 

Expert Comment

by:gunghoassassin
ID: 11768765
Using php5 with Windows is not yet a good idea.  It seems that there's a pretty common bug with php5 that crashes both apache 1.3 and apache 2 quite often, especially if you're using a high traffic server.
0
 
LVL 10

Expert Comment

by:iamanindian
ID: 13001715
Perhaps this link would be of some help:
http://www.solutions2day.com/small_business_solutions/viewtopic.php?p=6#6

Regards
Iamanindian
0
 

Expert Comment

by:JSalisbury
ID: 14292042
Same problem - same solution !!! Fixed thanks.
I copied the 228K dll from the php installation into windows/system32 and apache started OK.
I'm not quite sure how apache was grabbing the version that came with mysql - I'm just happy it works now.


0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question