Connecting Tech Pros Worldwide Forums | Help | Site Map

mysql / php5 configuration

jcoder
Guest
 
Posts: n/a
#1: Oct 18 '07
im using win xp and installed apache 2.x and php5...both working fine.
when i test:

<?php
phpinfo();
?>

it works fine. trouble starts when i started installing mysql 4.x
server on the same machine. mysql run successfully but the issue is i
cant integrate it with php. i already copied -- php_mysql.dll on my
\php\ext and libmysql.dll on \php as well as on \windows\system32.

also i made necessary changes on php.ini, but when i run :

<?php
mysql_connect("localhost","root","123") or die("cannot connect");
?>

it's not working. what could have gone wrong?


Jerry Stuckle
Guest
 
Posts: n/a
#2: Oct 18 '07

re: mysql / php5 configuration


jcoder wrote:
Quote:
im using win xp and installed apache 2.x and php5...both working fine.
when i test:
>
<?php
phpinfo();
?>
>
it works fine. trouble starts when i started installing mysql 4.x
server on the same machine. mysql run successfully but the issue is i
cant integrate it with php. i already copied -- php_mysql.dll on my
\php\ext and libmysql.dll on \php as well as on \windows\system32.
>
also i made necessary changes on php.ini, but when i run :
>
<?php
mysql_connect("localhost","root","123") or die("cannot connect");
?>
>
it's not working. what could have gone wrong?
>
>
What do you get for an error?

If it's just "cannot connect", print a REAL informative message - such
as that returned by mysql_error();

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

jcoder
Guest
 
Posts: n/a
#3: Oct 18 '07

re: mysql / php5 configuration


actually there's no error msg..it just gave me blank page.

<?php
mysql_connect("localhost","root","123") or die("cannot connect");
echo'ok';
?>

even the work "ok" is not showing either. im wondering, if my password
or username, or the host is wrong it should give me the msg "cannot
connect", but there's nothing. and if i restart apache, no error msgs
also.

Dap
Guest
 
Posts: n/a
#4: Oct 18 '07

re: mysql / php5 configuration


jcoder pisze:
Quote:
actually there's no error msg..it just gave me blank page.
>
<?php
mysql_connect("localhost","root","123") or die("cannot connect");
echo'ok';
?>
>
even the work "ok" is not showing either. im wondering, if my password
or username, or the host is wrong it should give me the msg "cannot
connect", but there's nothing. and if i restart apache, no error msgs
also.
>
try

if (function_exists(mysql_connect)) {
mysql_connect("localhost","root","123") or die("cannot connect");
print('OK');
} else {
print ('I forgot about php_mysql');
}

What does it show ?
also put error_reporting(E_ALL) at top of Your script

D.
Jerry Stuckle
Guest
 
Posts: n/a
#5: Oct 18 '07

re: mysql / php5 configuration


jcoder wrote:
Quote:
actually there's no error msg..it just gave me blank page.
>
<?php
mysql_connect("localhost","root","123") or die("cannot connect");
echo'ok';
?>
>
even the work "ok" is not showing either. im wondering, if my password
or username, or the host is wrong it should give me the msg "cannot
connect", but there's nothing. and if i restart apache, no error msgs
also.
>
>
OK, then in your php.ini file, enable display_errors and set
error_reporting to E_ALL. That will get you some error messages.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Henri
Guest
 
Posts: n/a
#6: Oct 18 '07

re: mysql / php5 configuration


On Wed, 17 Oct 2007 20:29:23 -0700, jcoder wrote:
Quote:
im using win xp and installed apache 2.x and php5...both working fine.
when i test:
>
<?php
phpinfo();
?>
>
it works fine. trouble starts when i started installing mysql 4.x server
on the same machine. mysql run successfully but the issue is i cant
integrate it with php. i already copied -- php_mysql.dll on my \php\ext
and libmysql.dll on \php as well as on \windows\system32.
>
also i made necessary changes on php.ini, but when i run :
>
<?php
mysql_connect("localhost","root","123") or die("cannot connect");
?>
>
it's not working. what could have gone wrong?
how can you tell it's not working?
Closed Thread