Jump to content

[SOLVED] mysqli error on mysql version 5.0.67 help please???


KDawg08

Recommended Posts

I have an error on my site... If this is in the wrong section I'm sorry, It is a mysql/php error...

 

Error: [1] [Fatal Error] Call to undefined function mysqli_real_escape_string()
Line: [200] /home/chithead/public_html/tube/common/classes/adodb/drivers/adodb-mysqli.inc.php

 

Here are the lines...

 

198         if (!$magic_quotes) {
199            if (PHP_VERSION >= 5)
200                  return "'" . mysqli_real_escape_string($this->_connectionID, $s) . "'";
201
202        if ($this->replaceQuote[0] == '\\')

 

Context Variables:

array (
 'matches' => 
 array (
   0 => 'Fatal error:  Call to undefined function  mysqli_real_escape_string() in /home/chithead/public_html/tube/common/classes/adodb/drivers/adodb-mysqli.inc.php on line 200',
   1 => 'Fatal error',
   2 => 'Call to undefined function  mysqli_real_escape_string()',
   3 => '/home/chithead/public_html/tube/common/classes/adodb/drivers/adodb-mysqli.inc.php',
   4 => '200',
 ),
 'val' => '200',
 'key' => 4,
)

 

I have MYSQL version 5.0.67 and for mysqli it says requires 5.0.7 or higher... if i upgrade MYSQL versions while hosting 24 websites, will it screw the other sites up that use MYSQL?

 

IF SO, is there a way around this error? i tried changing mysqli to mysql but it just added more errors.

Upgrading should have no effect on those sites, provided that you take care, that the configuration options stay the same.

Oh, and check if you have mysqli extension enabled at all in your php.ini

 

Any suggestions or advice on upgrading? I have cpanel/whm/ftp/ssh access, trying to find the easiest way without screwing up anything... I just wanna upgrade it as easy as possible without any downtime if possible.

actually it's a server hosted by ThePlanet.com but it's my server... i have to do this myself they won't do it. so i'm trying to figure out how to do it... any suggestions or ideas or know anyone that might be willing to take a few minutes to explain it to me via msn or something?

The php mysqli extension works with mysql 4.1 or higher -

 

The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above.

 

Where did you find the information that stated you need mysql 5.0.7, because that is not correct. You do need php5 to get the mysqli extension and that extension must be enabled.

 

The error means that the mysqli extension is not enabled in php. It also means that your code did not attempt to create a mysqli connection, because you would have gotten a similar error message about the mysqli_connect function being undefined.

I was told that 5.0.67 was lower...

 

my issue is that i was told mysqli isn't supported with that version of mysql... my php version is PHP version 5.2.8

 

Any suggestions how to get my server to support mysqli ? (Sorry if this sounds repetitive)

67 is higher than 7 so 5.0.67 is newer than 5.0.7

 

5.0.7 was released on June 10th 2005 link

5.0.67 was released on August 4th 2008 link

 

phpinfo

search for mysqli

 

Do you have ability to edit your php.ini file?

 

Oh... and I'am almost sure 5.0.67 supports mysqli, as I was using 5.0.51 which did.

This is what i find while searching for mysql

i even double checked it.

 

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
mysql.default_port =

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =

; Maximum time (in seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
mysql.trace_mode = Off

[mSQL]
; Allow or prevent persistent links.

I run a Cent OS server if that makes any difference... my php.ini is in usr/local/bin unless FC7 etc. Hosted by The Planet

 

My best bet is have them enable it for me then?

 

i have DYNAMIC Extensions section but that's for WINDOWS and CentOS is linux...

PHP must to be compiled with mysqli support if you wish to use it.

 

configure --with-mysqli

 

Do a phpinfo() and check the parameters used when PHP was compiled.

 

conf.gif

 

If you do not see it, it means you have to recompile PHP.

 

Angel

Build Date 	Dec 22 2008 10:57:54
Configure Command 	'./configure' '--disable-pdo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-png-dir=/usr' '--with-ttf' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' 

 

i don't see it in there.

Well i asked them to upgrade it for me, posted a link to this thread and this is what i got back...

 

Michael C. - Thursday February 19th, 2009; 4:56 AM CST
Dear Customer,

While the information provided to you may be correct, as you are the servers administrator you'll need to upgrade php and mysql.

You'll need to use "/scripts/mysqlup --force" from ssh and it should update you to that latest version supported by cpanel.

Thank you for choosing The Planet.

MichaelC
Technical Support
www.ThePlanet.com

 

Any suggestions now? I am told I have to upgrade it and i'm not sure how to do any of this, and i don't wanna screw up my server.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.