[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 910
  • Last Modified:

PHP5 and MySQL 3.23

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
nguyen_vantuananh
Asked:
nguyen_vantuananh
1 Solution
 
ldbkuttyCommented:
have you Copied php_mysql.dll to c:\windows\system32 ?
0
 
nguyen_vantuananhAuthor Commented:
I also try to copy that file to $system$ folder, but cant solve problem
0
 
cachedVBCommented:
maybe its one built for php3 and php5 doesnt support it anymore
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
NchMchCommented:
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
 
nguyen_vantuananhAuthor Commented:
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
 
NchMchCommented:
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
 
NchMchCommented:
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
 
nguyen_vantuananhAuthor Commented:
OK, everything is so clear to me now. Thank for your help. :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now