BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.3 support => Topic started by: captainwinky on May 27, 2006, 08:07:45 am

Title: MySql problem
Post by: captainwinky on May 27, 2006, 08:07:45 am
heya,
i hope this is the correct place for this query.
apon trying to run any BeBot newer than 0.2, i get

MySQL support required to run this bot

i am currently running 0.2.2 without any real problems, but would like to fiddle with newer versions to amuse myself in the wee hours of the morning :p

a little system info regarding mysql and php:

mysql  Ver 14.12 Distrib 5.0.21, for pc-linux-gnu (i486) using readline 5.1

PHP 5.1.2-1+b1 (cli) (built: Mar 20 2006 04:17:24)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

any pointers would be appreciated :)
Title: Re: MySql problem
Post by: Xenixa on May 27, 2006, 02:25:55 pm
You need to ensure both the php_mysql(handles mysql functions) and libmysql(handles mysql connections) extentions are being loaded at runtime. Check the local php.ini for the bebot install.
Title: Re: MySql problem
Post by: captainwinky on May 29, 2006, 05:06:11 am
had a little look at ../BeBot/php.ini
it seems to suggest the extensions section is for Windows.  is there also something that needs doing here on Linux?

also took a look at some of my system's php.ini files.  no mention of php_mysql or libmysql in them. 

sorry for my noobness, and all the questions that come as a result of it :)
Title: Re: MySql problem
Post by: Khalem on May 30, 2006, 04:54:15 am
Im heading to bed so i dont have the time to do much right now.

But this is the second time ive heard of the problem. The first person ended up downgrading without giving me a chance to try and diagnose the problem.

If you have a 0.2.2 working, its obvious that you have php with MySQL compiled in.
What i fail to understand offhand is why the following in main.php fails to detect the MySQL module being part of php:
Code: [Select]
if (!extension_loaded("mysql"))
{
if ($os_windows)
{
if (!dl("php_mysql.dll"))
{
die("Loading php_mysql.dll failed. MySQL extention required to run this bot");
}
}
else
{
die("MySQL support required to run this bot");
}

}

Has something changed on *nix when it comes to PHP and MySQL in 5.0/5.1 that im unaware of?

In any case, commenting out the die() statement in main.php should allow you to run newer versions for now.
Im wondering if this is a shell account though, and if it would be possible to obtain temporary access to it to do some testing.
Title: Re: MySql problem
Post by: captainwinky on June 08, 2006, 04:19:29 pm
Thanks Khalem.  I'll give that a try when I have a bit of spare time.
Regarding testing, I might be able to arrange that (assuming I have not misunderstood what you meant there).  I would need to speak to my network admin though to determin whether it's possible due to my being behind a bit of masquerading and such (and whether he would allow it) :)
Title: Re: MySql problem
Post by: Vhab on June 08, 2006, 04:28:30 pm
maybe use function_exists("mysql_connect") instead to check whether it's loaded?
Title: Re: MySql problem
Post by: senare on July 10, 2006, 01:11:02 pm
hum dont know if this is related but however ... if ppl are running Ubuntu linux wich i belive is quite popular nowdays :) do be aware that there are a bug in the php4_mysql. (double check that the package is there with the php -m ) it might not install properly from apt-get.

/chowkow

PS u will get the

"Fatal error: Call to undefined function mysql_connect() in /home/samba/Bebot/BeB                                                                             ot_v0.2.8/MySQL.php on line 63"
fix it with
"sudo dpkg-reconfigure php5-mysql"
or similar  DS
Title: Ubuntu linux
Post by: paal on October 17, 2006, 04:33:45 am
Seems like Ubuntu has the php configured so it uses the php.ini file that exists in the bebot dir instead of the cli one.
was stuck for a few hours before i finaly figured it.
moving / deleteing the file fixed my problem and i could continue to the "AOChat: not expecting login." one :o
Title: Re: MySql problem
Post by: Malosar on October 17, 2006, 02:14:27 pm
php will always use local php.ini settings and resort to global settings for everything else, unless specified otherwise.

Good luck with the "not expecting login" problem  :P
Title: Re: MySql problem
Post by: lulifuz on August 24, 2007, 08:29:20 pm
Hi there,

I am trying to upgrade from Bebot 0.2.x to 0.4.x.
I thought the most difficult part would be the conversion of the database.
But now I don't even get the Bot running.
First I was getting the
'MySQL support required to run this bot'
message, so i commented the die() statement out as Khalem suggested.
Ok, but then I get to the error:
'Fatal error: Call to undefined function mysql_connect() in /home...'
as senare describes.
Quite crazy, as version 0.2.x is running and using this also.
I have a Ubuntu installation and the cli version of php 4.4.something running.

Any Ideas?

Regards,

 lulifuz
Title: Re: MySql problem
Post by: Alreadythere on August 24, 2007, 08:44:21 pm
Try adding extension=mysql.so to your php.ini.
Title: Re: MySql problem
Post by: Temar on August 25, 2007, 02:42:43 am
i changed my startbot.php i think i had same error

Code: [Select]
{
/*
This is a sane default for the php binary on Unix systems.
If your php binary is located someplace else, edit the php_bin path accordingly.
*/
// $php_bin = trim(shell_exec('which php'));
// $php_args = " -c ./ ";
$php_bin = "/usr/bin/php";
$main_php = "Main.php";
}
Title: Re: MySql problem
Post by: lulifuz on August 25, 2007, 10:31:33 am
Hi again,

thanks to both of you.
The line extension=mysql.so in the php.ini was alreadythere Alreadythere ;-)

So I tried what Temar suggested and that worked.
As I am a curious guy I tried to comment only the line:
//$php_args = " -c ./ ";
and this worked also.
This arg lets php look for the .ini file in directory ./.
Strange, as I have renamed the .ini file in the Bebot dir.

Anyway, now it works and I am happy.

Regards,

 lulifuz
SimplePortal 2.3.7 © 2008-2024, SimplePortal