Fatal Error - Undefined function mysqli_connect

Fatal Error - Undefined function mysqli_connect

am 04.09.2011 11:31:58 von Ben

------=_NextPart_000_00D4_01CC6AB3.33B4D100
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi,



My server was upgraded to PHP 5.3.8 and MySQL 5.1.58 today and, since, I am
getting a 500 error on any script requiring a DB connection.



I've tried using the Procedural style example provided at
http://www.php.net/manual/en/mysqli.connect.php (as shown below), but get
the following line in my error logs:



PHP Fatal error: Call to undefined function mysqli_connect() in
DOC_ROOT/test2.php on line 2



----- Sample code


$link = mysqli_connect('localhost', 'my_user', 'my_password', 'my_db');



if (!$link) {

die('Connect Error (' . mysqli_connect_errno() . ') '

. mysqli_connect_error());

}



echo 'Success... ' . mysqli_get_host_info($link) . "\n";



mysqli_close($link);

?>



If I run phpinfo(), I see the following:

Configure Command: ..'-without-mysql'..

Additional .ini files parsed: .. /etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini.. /etc/php.d/pdo_mysql.ini



Is there something wrong with the installation of PHP/MySQL?



Any help would be greatly appreciated. Thanks,



Ben Miller




------=_NextPart_000_00D4_01CC6AB3.33B4D100--

Re: Fatal Error - Undefined function mysqli_connect

am 04.09.2011 11:38:58 von Lester Caine

Ben wrote:
> My server was upgraded to PHP 5.3.8 and MySQL 5.1.58 today and, since, I am
> getting a 500 error on any script requiring a DB connection.
Upgraded from what?
Sounds like the mysqli extension is no longer getting loaded. There will either
be an error saying why, or it is still commented out in the php.ini.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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

RE: Fatal Error - Undefined function mysqli_connect

am 04.09.2011 11:44:59 von Ben

Lester wrote:
>Upgraded from what?
> Sounds like the mysqli extension is no longer getting loaded. There will
either be an error saying why, or it is still commented out in the php.ini.

Upgraded from PHP 4.3 and MySQL 4.1. Was using mysql_connect, but
understand that mysqli is better/supported extension for newer versions, so
am trying to rewrite the code to use mysqli_connect. For what it's worth,
mysqli_init() also produces "Call to undefined function mysqli_init()" in my
error logs.

Thanks again,

Ben Miller



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

Re: Fatal Error - Undefined function mysqli_connect

am 04.09.2011 14:29:07 von Lester Caine

Ben wrote:
>> Upgraded from what?
>> > Sounds like the mysqli extension is no longer getting loaded. There will
> either be an error saying why, or it is still commented out in the php.ini.
>
> Upgraded from PHP 4.3 and MySQL 4.1. Was using mysql_connect, but
> understand that mysqli is better/supported extension for newer versions, so
> am trying to rewrite the code to use mysqli_connect. For what it's worth,
> mysqli_init() also produces "Call to undefined function mysqli_init()" in my
> error logs.

That would explain the problem ;)
Need the mysqli extension enabled instead of mysql ...

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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