collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: MySql problem  (Read 23291 times)

0 Members and 1 Guest are viewing this topic.

Offline captainwinky

  • BeBot User
  • **
  • Posts: 32
  • Karma: +0/-0
MySql problem
« 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 :)

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: MySql problem
« Reply #1 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.
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline captainwinky

  • BeBot User
  • **
  • Posts: 32
  • Karma: +0/-0
Re: MySql problem
« Reply #2 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 :)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: MySql problem
« Reply #3 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.
BeBot Founder and Fixer Kingpin

Offline captainwinky

  • BeBot User
  • **
  • Posts: 32
  • Karma: +0/-0
Re: MySql problem
« Reply #4 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) :)

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: MySql problem
« Reply #5 on: June 08, 2006, 04:28:30 pm »
maybe use function_exists("mysql_connect") instead to check whether it's loaded?

Offline senare

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: MySql problem
« Reply #6 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
« Last Edit: August 27, 2006, 11:45:18 am by senare »

Offline paal

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Ubuntu linux
« Reply #7 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

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: MySql problem
« Reply #8 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
Eternalist
General of The Syndicate

Offline lulifuz

  • BeBot User
  • **
  • Posts: 40
  • Karma: +0/-0
Re: MySql problem
« Reply #9 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: MySql problem
« Reply #10 on: August 24, 2007, 08:44:21 pm »
Try adding extension=mysql.so to your php.ini.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: MySql problem
« Reply #11 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";
}

Offline lulifuz

  • BeBot User
  • **
  • Posts: 40
  • Karma: +0/-0
Re: MySql problem
« Reply #12 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

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 285
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal