?
Solved

PHP5 and MySQL 3.23

Posted on 2004-09-22
8
Medium Priority
?
914 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
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
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
 

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 147 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
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.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…
Suggested Courses

588 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