Board index   FAQ   Search  
Register  Login
Board index php forum :: Database MySQL Installation

HELP: Connection issues PHP/MySQL

Installation and configuration iussues

Moderators: macek, egami, gesf

Postby ruturajv » Wed Nov 17, 2004 8:58 am

try
Code: Select all
<?php
phpinfo();
?>


and see if mysql module is enabled.
otherwise u need to enable it in the php.ini file
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby Alexej Kubarev » Mon Dec 27, 2004 8:41 am

okej... first question: what versions of php and mysql,
second question: did u configure Apache to use PHP?

If you use PHP5 -- you will need to load mysql or mysqli module to use databases...

php_mysql.dll is for MySQL<=4.0
php_mysqli.dll is for MySQL >= 4.1

Please chck that and would be good if we get more info
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Problems connecting too

Postby jrts2 » Wed Apr 20, 2005 4:24 am

PHP 5.0.4
MySQL 4.1

PHP works on localhost. MySQL works from console.
They don't connect. In particular:
unknown command mysql_connect

phpinfo() doesn't have a MySQL section.
there isn't a mysqli.dll extension listed in php.ini
when i activated php_mysql.dll (and later php_mysqli.dll) i got...
PHP Startup: Unable to load dynamic library './php_mysql.dll' - the specified module could not be found.

I tried PHP 4.3.11 which then did have a MySQL section in phpinfo()
but running MySQL commands yields
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client

I'm stumped and would really appreciate help
:)
jrts2
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Apr 20, 2005 4:05 am

i think i've solved it

Postby jrts2 » Thu Apr 21, 2005 8:43 am

i didn't have the php_*.dll extensions installed...
jrts2
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Apr 20, 2005 4:05 am

Postby Alexej Kubarev » Thu Apr 21, 2005 9:46 am

let me guess -- used installer?!

How many times do people need to make the same misstake to learn: USE ZIP FILES :D
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

a couple of other points

Postby jrts2 » Fri Apr 22, 2005 3:30 am

in case anyone else used the installer...
use the zip!
activate the php_mysqli.dll extension in php.ini
and remember to use mysqli_* functions instead of mysql_*
eg mysqli_connect("localhost","username","password");
:)
jrts2
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Apr 20, 2005 4:05 am

Postby Alexej Kubarev » Fri Apr 22, 2005 6:04 am

Or you may use php_mysql.dll as well as PHP5 has support for both and there is a very easy way to configure mysql to work with old dlls as well..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

I can't find php_mysql.dll

Postby alopas » Mon Jul 18, 2005 2:13 pm

Hi, I just started playing with php and can't connect it to mysql. I'm missing the php_mysql.dll (also php_mysqli.dll), it's not in the extensions folder (I downloaded php-4.4.0-Win32.zip from php.net) ... is it suppose to be there? I have enabled php_mysqli.dll and now when I start apache I get this message:

Unknown(): Unable to load dynamic library '.php_mysql.dll - The specified module could not be found

:help: Thanks very much in advance!
alopas
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jul 18, 2005 1:53 pm

Postby Alexej Kubarev » Tue Jul 19, 2005 3:09 am

download the PECL extentions zip as well: however its a bit weird that mysql library is not there. mysqli will NOT be there as its only for PHP5
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby alopas » Tue Jul 19, 2005 5:34 am

Thanks for your reply Alexei :)

There is no PECL zip file in php.net for php 4, so I dowoloaded the one for php 5. The dll files are not there either! I'm looking for php_mysql.dll and libmySQL.dll. Right now I'm using the libmySQL.dll file that came with mySQL, because it didn't came with the php4 download.

Summarzing: php_mysql.dll and libmySQL.dll are NOT included in the php-4.4.0-Win32.zip file that can be downloaded from php.net. I think I need those files so it doesn't show the message "Unknown(): Unable to load dynamic library '.php_mysql.dll - The specified module could not be found " when I start Apache. I don't know what to do, I'm just about to give up :-x
alopas
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jul 18, 2005 1:53 pm

Postby Alexej Kubarev » Tue Jul 19, 2005 6:00 am

okey: well...
libmysql.dll comes ONLY with MySQL server

# PHP 4.4.0 zip package [6,807Kb] - 11 Jul 2005
(CGI binary plus server API versions for Apache, Apache2 (experimental), ISAPI, NSAPI, Servlet and Pi3Web. MySQL support built-in, many extensions included, packaged as zip)
md5: bf5dfbda3cbf90609eaac8865145e052

Pecl Extentions are not yet released for 4.4.0


In case you want to use PECL extentions for PHP5 you HAVE to use php5 as well: extentions will ONLY work with the php version they are built for
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby alopas » Tue Jul 19, 2005 5:45 pm

Thanks Alexei. What I don't understand is why when I activate extension=php_mysql.dll (in php.ini) and afterwards I re-start apache, I get the message: "Unknown(): Unable to load dynamic library '.php_mysql.dll - The specified module could not be found "

How can I fix this?? Thanks very much for your patience! :)
alopas
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jul 18, 2005 1:53 pm

Postby alopas » Tue Jul 19, 2005 7:22 pm

Error message problem solved ... getting closer! :D

This is what I did: I got rid of PHP 4 and installed PHP 5. I still got the same message, but I copied php_mysqli.dll and php_mysqli.dll in the windows folder and now the message is no longer showing. (I couldn't do that with PHP 4 because those files are not included in the zip package)

BUT, I created a db in mysql, did a test, and just showed a blank page, not even an error message ... what is happening now??? The test query is this:

<?
$db=mysql_connect("localhost","root","*****");
mysql_select_db("prueba",$db);
$query="SELECT * FROM tabla1";
$result=mysql_query($query);
$table=mysql_field_table($result,0)
echo $table;
?>
Any ideas? Thanks very much! :)
alopas
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jul 18, 2005 1:53 pm

Postby alopas » Wed Jul 20, 2005 5:15 am

OK, getting frustrated again ... :-x

This is what I found out: if I add "phpinfo();" at the begining of the script the browser still shows a blank page. BUT, if I eliminate the last "echo $table;" it DOES show the phpinfo() table. If I substitute "echo $table:" by any other echo line like "echo "whatever";", the blank page shows again.

I just started with php and I'm completelly lost ... please help! Thanks very much.
alopas
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jul 18, 2005 1:53 pm

Postby Alexej Kubarev » Wed Jul 20, 2005 5:27 am

hmmz... this is VERY weird..
i think it would be good if you tell us about your server configuration.. also you might need to post your php.ini file.. Im using Apache 2 and php 5.0.4 and therefore am able to configure where my php.ini is placed (in php root folder in my case)

but by default it has to be in c:\Windows folder... dont forget to copy php5ts.dll or what ever it is called to the windows folder as well.
On windows systems it is really hard for the OS to find the Extentions if they are not in the folders defined in PATH variable. What you can do is define C:\PHP in Windows PATH variable and will solve most of the problems.

I hope you followed the guide on http://www.php.net on how to install everything
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby alopas » Wed Jul 20, 2005 6:04 am

... dont forget to copy php5ts.dll or what ever it is called to the windows folder as well.


THAT WAS IT!!! :D

Thank you VERY MUCH Alexei! :) :? :D
alopas
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jul 18, 2005 1:53 pm

Postby alopas » Wed Jul 20, 2005 9:02 am

Tip for newbies (like me):

The browser will also show a blank page if you just specify the "localhost":

e.g.: $db=mysql_connect("localhost");

You need to specify also the other two parameters:

$db=mysql_connect("localhost","root","password");
alopas
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jul 18, 2005 1:53 pm

Postby sandieflores » Thu May 04, 2006 8:28 pm

1;WHat to do in the php.ini file in the WINDOWS folder?

2;I have the ZIP file of php_mysql.dll and libmySQL.dll, where shall i put these files?

3; still the same error found, if I will use the mysqli_connect FATAL ERROR is the result, if mysql_connect, Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client


I use PHP5
MySQL 4.1
Apache 1.3

Need reply please....
sandieflores
New php-forum User
New php-forum User
 
Posts: 7
Joined: Wed May 03, 2006 5:40 pm

Postby sandieflores » Fri May 05, 2006 7:51 pm

I mean

PHP 4
Apache 1.3
MySQL4.1
sandieflores
New php-forum User
New php-forum User
 
Posts: 7
Joined: Wed May 03, 2006 5:40 pm


Return to MySQL Installation

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron