Solved

PHP5 and MySQL 3.23

Posted on 2004-09-22
8
874 Views
Last Modified: 2013-12-12
I've installed IIS, PHP5 and MySQL 3.23 on my local webserver
I edit php.ini file to enable loading extension libraries file.
Problem come to when I load MySQL library file: php_mysql.dll
A warning displaywhen I brower a *.php file from webserver. The warning is:
PHP Startup: Unable to load dynamic library 'C:\PHP5\ext\php_mysql.dll' - The speciafied module could not be found.
I don't know why even though I checked carefully the path in php.ini and in my hard disk. Both is the same. The other extension libraries is loaded ok, for example php_mssql.dll or php_snmp.dll
Could you show a way to fix this problems
Thanks!
0
Comment
Question by:nguyen_vantuananh
8 Comments
 
LVL 32

Expert Comment

by:ldbkutty
ID: 12120819
have you Copied php_mysql.dll to c:\windows\system32 ?
0
 

Author Comment

by:nguyen_vantuananh
ID: 12121216
I also try to copy that file to $system$ folder, but cant solve problem
0
 
LVL 4

Expert Comment

by:cachedVB
ID: 12122033
maybe its one built for php3 and php5 doesnt support it anymore
0
 
LVL 1

Expert Comment

by:NchMch
ID: 12137508
To install MySQL 3.x extension with PHP 5 (assuming you've installed it in C:\PHP5\):
1. in php.ini:
   extension_dir = "C:\PHP5\ext"
uncomment
   extension=php_mysql.dll

2. Make sure C:\PHP5\ext\php_mysql.dll exists.

3. Copy libmysql.dll (it should be in C:\PHP5\ directory) to C:\WINDOWS\system32\. If you don't move libmysql.dll to  C:\WINDOWS\system32 you are likely to get "can't load c:\php5\ext\php_mysql.dll" [looks familiar? ;)]

Here is the official information:
http://www.php.net/manual/en/faq.databases.php#faq.databases.mysql.php5

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:nguyen_vantuananh
ID: 12139519
Thank NchMch!
Your solution is OK.
By the way, could you show me how I can change the host name of MySQL server. Normally, my web server have a name, for example SERVERTEST, but in connect string, I must use LOCAHOST to connect to MySQL server.
Exactly, I want to use the name SERVERTEST in connect string.
Can you help me?
0
 
LVL 1

Expert Comment

by:NchMch
ID: 12142119
I understand you want to change hostname used in yuur PHP scripts. Normally, you should use 'localhost' for development. You can try using different name, though:

1) If SERVERTEST is only your made-up local name, and it's not supposed to resolve to your network card IP you can modify your "C:\WINDOWS\system32\drivers\etc\hosts" file so SERVERTEST always resolves to 127.0.0.1. Add the following line:
127.0.0.1       SERVERTEST

2) If SERVERTEST is your network host, and it resolves for example to "192.168.0.1" you can use the "bind-address" option in your my.cnf or my.ini to make your MySQL server listen on this IP.
To make it listen on specified IP only (eg. 192.168.0.1):
    * Add bind-address=192.168.0.1 to section [mysqld] of my.ini (/my.cnf)

Note, that if you don't specify bind-address, MySQL will listen on all addresses available.
Still, you need to allow access to it by creating/modifying the appropriate accounts.
You can do so using the GRANT command or by using some frontend, like phpMyAdmin or MySQL-Front.
- connect to your server as root
- choose the 'user' table in 'mysql' database
- you will see user accounts table, modify the 'host' value of each user to match your needs (use % to allow access from all hostnames - not very secure solution, though).

0
 
LVL 1

Accepted Solution

by:
NchMch earned 49 total points
ID: 12142224
One additional warning here - be VERY careful NOT to disallow access to user 'root' from host 'localhost' because you might not be able to access your database then. Also, it's better not to use 'root' user to access your MySQL database via PHP scripts - for example, malicious/untested script could damage your database. Create additional user, with restricted permissions. Read this - http://dev.mysql.com/doc/mysql/en/Adding_users.html .
If you prefer GUI tools, I think you can also use MySQL Administrator (http://dev.mysql.com/downloads/administrator/index.html), but reading information in the above URL is still recommended.
0
 

Author Comment

by:nguyen_vantuananh
ID: 12148857
OK, everything is so clear to me now. Thank for your help. :)
0

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now