Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2004-11-09, 07:56 PM
Junior Member
 
Join Date: Nov 2004
Posts: 1
blah3001
Default

Here's what I'm running:

Windows 98
PHP 5.0.2
MySQL 4.0.20a
Apache 2.0

I have set up Apache and PHP so that the Apache server can interpret PHP code. The problem is that I can't get PHP to use MySQL. I have configured PHP in order to get MySQL working but when I run Apache I get the following error:

PHP Startup: Unable to load dynamic library 'c:\php\ext\php_mysql.dll' - A device attached to the system is not functioning.

After the error, the Apache server continues to run but any PHP code that involves the use of MySQL does not output anything at all, not even an error. Any code without the use of MySQL works fine.

I have followed the steps explained in the PHP, MySQL manuals:

In php.ini:
1. extension_dir = "c:\php\ext"
2. Uncommented the line: ;extension=php_mysql.dll in order to include the MySQL extension.

I've put libmysql in c:\php, c:\php\ext, c:\windows\system, c:\windows\system32
I've put php_mysql.dll in c:\php\ext
I've set PATH in autoexec.bat to include c:\php and c:\php\ext

Can anyone help me to resolve this error? Thanks in advance.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2005-01-03, 03:01 PM
Junior Member
 
Join Date: Jan 2005
Posts: 1
mkingbeats
Default

put libmysql in c:\windows, not c:\windows\system32, try that tell me if it works .
Reply With Quote
  #3 (permalink)  
Old 2005-01-04, 07:43 AM
Junior Member
 
Join Date: Jan 2005
Posts: 2
bhavin
Default

hi
i'm havin the same problem except i'm running on windows XP

i have tryed your suggestion... but still doesnt work,

My php list doesnt recognise mysql when i load the following command with my browser.
phpinfo();

i do get a error out when i querry mysql
*Fatal error: Call to undefined function mysqli_connect() in C:\Website\Webpages\sqltest.php on line 12*

help
thanks



[i]
Reply With Quote
  #4 (permalink)  
Old 2005-01-04, 11:59 AM
Junior Member
 
Join Date: Jan 2005
Posts: 19
nicedreams242
Default

Try using mysql_connect() instead of mysqli_connect() they are two seperated functions. Also make sure MySQL is showing up in the phpinfo().

I am using almost exactly the same setup as you except on XP.

To correct mkingbeats
"c:\windows, not c:\windows\system32" Unless this is exclusive to Windows 98 it is not correct. They do in fact need to be in the System32 folder. There are no DLL files in the Windows Directory.
Reply With Quote
  #5 (permalink)  
Old 2005-01-04, 06:54 PM
Junior Member
 
Join Date: Jan 2005
Posts: 2
bhavin
Default

hey nicedreams242
tryed the changes you suggested... that was what i had intially configured as
but reverting back and still the same error occurs.
i dono how to get sql to show up on the php info page...

could you please tell me which versions you are using? and please mail me your php.ini file...might help me see if i'm doing somethig wrong there?
bhau2@yahoo.com

this is eatin my head why wont it work arggg

thanks dude
Reply With Quote
  #6 (permalink)  
Old 2005-01-23, 07:22 AM
Junior Member
 
Join Date: Jan 2005
Posts: 2
Permanence
Default

Quote:
Originally posted by bhavin@Jan 4 2005, 12:43 PM


i do get a error out when i querry mysql
*Fatal error: Call to undefined function mysqli_connect() in C:\Website\Webpages\sqltest.php on line 12*
Hi, Im new to php and mysql and i have got the exact same error msg as this guy!

However I cant get mySQL to come up in the phpinfo file. could someone please tell me how i go about getting it in the info and making sure it is enabled?
Reply With Quote
  #7 (permalink)  
Old 2005-01-25, 03:44 AM
Junior Member
 
Join Date: Jan 2005
Posts: 19
nicedreams242
Default

You need to make sure extension_dir in your php.ini is correct first. Then you have to uncomment the extensions you want to load in that file as well. (***That DLL must be in that directory that you set extension_dir to!!!)

EX.
extension_dir = C:/PHP/extensions
extension = php_mysql.dll

Also you may have to have a few other of the DLL's from the distro in the SYSTEM32 folder. Specifically libmysql.dll for MySQL. If you are running PHP as an Apache module you will need to restart Apache after. Then MySQL should show up in the phpinfo(). But your function call will be mysql_connect() instead of mysqli_connect(). But that is another extension for MySQL that you could also use but I just use the original.
Reply With Quote
  #8 (permalink)  
Old 2005-01-31, 12:10 AM
Junior Member
 
Join Date: Jan 2005
Posts: 2
Permanence
Default

Took your advice which seemed to clear up first problem .... now these are the error msgs I am getting .....

Warning: mysqli_connect() [function.mysqli-connect]: Access denied for user 'root'@'localhost' (using password: NO) in E:\Appz\Apache Group\Apache2\htdocs\mysql_up.php on line 12

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in E:\Appz\Apache Group\Apache2\htdocs\mysql_up.php on line 14

Warning: mysqli_errno() expects exactly 1 parameter, 0 given in E:\Appz\Apache Group\Apache2\htdocs\mysql_up.php on line 16

Warning: mysqli_error() expects exactly 1 parameter, 0 given in E:\Appz\Apache Group\Apache2\htdocs\mysql_up.php on line 17
Error :

... i have no idea what this means or how to fix.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:16 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.