Hi:

my server is centos (CentOS release 5.6 (Final) ).

I have a strange problem with mysqli .
the mysqli connection only works with command line script , not web page script.

I have fiollowing code inside my php script  test.php:

$connection = mysqli_init();

mysqli_real_connect($connection,$host,$user,$pass,$database);
var_dump(mysqli_connect_errno(), mysqli_connect_error());

so when run that file under command line, it is ok, but in web page,
it return error code "2003",
and error message Can't connect to MySQL server on xxxxxx

linux version is  2.6.18-238.19.1.el5xen #1 SMP Fri Jul 15 08:16:59
EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

regards,

anru

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to