Re: Can't get MySQL extensions to load

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Run phpinfo again and see if the mysql extension shows as loaded. You
should see a section in the output from phpinfo about mysql. If you do
not see that section than the mysql extension is not loaded. 

If the mysql extension shows that it is loading then it may be something
with the mysql server. Try to connect to the mysql server from the
windows command prompt:

mysql -h 127.0.0.1 -u username -ppassword

If you can connect with that string try the same string in php:
<?php
$db_link = mysql_connect('127.0.0.1', 'username', 'password');
if (!$db_link) {
	// connection failed
	print "MySQL connection failed. Error was: " . mysql_error();
} else {
	print "Connection successful!";
	mysql_close ($db_link);
}
?>

That code could have a bug in it because it is all from memory and
untested, but you should get the idea.

If the mysql extension is loading but the php connection won't work post
the response (the mysql_error above) that should help determine the
problem.

I have never worked with Win 2003, but it could be that the default
firewall is blocking the mysql connection. Maybe try turning it off or
creating an exception for the mysql server (TCP port 3306). 

Thanks,
James



Since you said that you were using the newest PHP
On Sun, 2007-12-09 at 00:11 -0500, Patrick Farley wrote:
> Evening.
> 
>  
> 
> I've installed the latest PHP using the zip files (not the installer) to my
> Windows 2003 machine with IIS.  I have tested the installation with a
> phpinfo() and was successful.  I installed Roundcube and when trying to
> connect to the site was greeted with an error about being unable to connect
> to the database.  I rechecked my connection string and all seemed well.
> Figuring I'd come back to it later, I went to install Joomla and during the
> install process was told that Joomla is unable to connect to MySQL.
> 
>  
> 
> I have checked and rechecked my php.ini file (though I may be missing
> something not obvious)
> 
> PHP in general works.
> 
> My system PATH is configured for C:\php and I have restarted several times
> 
> I've even redownloaded the php zip files and compared the md5 to make sure
> it was not corrupt.
> 
> MySQL is active and working on localhost for an email server without any
> issue.
> 
> Have tried both mysql.dll and mysqli.dll
> 
> I have searched Google with out any success.
> 
>  
> 
> Is this something with PHP or my MySQL install?  I'm out of ideas.
> 
>  
> 
> 
> 
> 
> 
> Patrick
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux