Solved

Windows PHP5 MySQL installation problems

Posted on 2004-07-30
8
48,690 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

695 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