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

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

Author Topic: BeBot on Linux (newbie)  (Read 3458 times)

0 Members and 1 Guest are viewing this topic.

Offline spypower

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
BeBot on Linux (newbie)
« on: August 20, 2009, 12:37:58 am »
Hi there, n thanks for reading my post.

In the past 10 hours i'm trying to setup a debian system for my bot. Well, since it was my first touch with a unix system, i had problems on the wlan0 iface etc etc. After all the hardware probs, after installing (i think) the MySql server, instlaling the php5.2, unzipping the files to a folder on the debian server.. i have a lil problem running the bot right now.

Code: [Select]
Fatal error: require_once(): Failed opening required './Sources/Conf.php' (include_path='.:/usr/share/php:/usr/share/pear') in /bot/StartBot.php on line 73

The file is there, but still have no idea what to check.

Hope someone knows what's going on.

Offline spypower

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: BeBot on Linux (newbie) {SEMI SOLVED}
« Reply #1 on: August 20, 2009, 01:48:26 am »
Solved by Malaxia
Code: [Select]
[Malaxia]: now type "ls -l Conf.php"
Um, another question if its possible, is there a way to copy the members from my bot i had on windows to this bot on the unix? Which files should i look at?

Offline Nogoal

  • BeBot Apprentice
  • ***
  • Posts: 77
  • Karma: +0/-0
Re: BeBot on Linux (newbie)
« Reply #2 on: August 20, 2009, 09:36:47 am »
If you had same bot version on your windows and on your linux I guess you could just copy the folder named after your bot database. Never did this but it should work I think.

Under windows you'll find the folder in mysql/data. Under linux it's in /var/lib/mysql.

If it doesn't work easiest solution would be to export the table(s) you want in a sql file.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: BeBot on Linux (newbie)
« Reply #3 on: August 20, 2009, 12:33:37 pm »
You will need to dump the database on your windows system and import it on your linux system using mysql_dump or another MySQL tool like SQLYog.

There is a post somewhere describing the process but i don't have time to search for it atm.
BeBot Founder and Fixer Kingpin

Offline Dochere

  • BeBot User
  • **
  • Posts: 43
  • Karma: +0/-0
Re: BeBot on Linux (newbie) {SEMI SOLVED}
« Reply #4 on: August 31, 2009, 04:05:44 pm »
Solved by Malaxia
Code: [Select]
[Malaxia]: now type "ls -l Conf.php"
Um, another question if its possible, is there a way to copy the members from my bot i had on windows to this bot on the unix? Which files should i look at?


How did you actually solve it? Typing "ls -l Conf.php" did no magic at my webhost. Thing is that i know what the problem is but i have no clue how to work with it, if i hardcode all paths into bebot it seems like it will do its job but hey, i dont want to recode all "pathed" settings into bebot.

as now most paths are relative e.g: "./Conf/Bot.conf" but if i hardcode "/home/username/Bebot/conf/Bot.conf" itl go onto next file with basicly same error "not found". And with all these files id rather like to see a solution to it.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: BeBot on Linux (newbie)
« Reply #5 on: August 31, 2009, 04:48:28 pm »
Sounds like an issue with your webhost, not BeBot. I have no problem running multiple bots under Linux.

You are trying to run BeBot as a PHP script, not a webpage correct:

WRONG: http://server.hostname.com/path/StartBot.php


RIGHT: php StartBot.php

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: BeBot on Linux (newbie)
« Reply #6 on: August 31, 2009, 04:49:11 pm »
I'm afraid there is no real solution to your issue Dochere if i have understood your posts correctly as you are running the bot outside a supported enviroment.

You are running the bot from a webhost, and presumeably launching it from a webserver?

In any case you are running the bot in a way that is not supported nor recommended. And i am very suprised that your hosting company is allowing you to run a background process on a webserver at all.

That said, it's probably possible to force the working directory using the php chdir() function.
See http://no2.php.net/manual/en/function.chdir.php

But again, from what i can tell your operating enviroment is not supported and very heavily discouraged.
And please do not contact us if someone on said webserver compromises your AO Account or the likes due to running the bot in an insecure enviroment.

BeBot Founder and Fixer Kingpin

Offline Dochere

  • BeBot User
  • **
  • Posts: 43
  • Karma: +0/-0
Re: BeBot on Linux (newbie)
« Reply #7 on: August 31, 2009, 07:35:22 pm »
found a working solution!!!


/usr/bin/php /home/username/botdir/StartBot.php > /dev/null &


and mysql_pconnect was also needed to do this. Running on a Hostgator webserver. a little singleton script makes sure my cron job not restart and starts new instaces of the bot (iwe got cron set to every hour incase anything were to happend).

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: BeBot on Linux (newbie)
« Reply #8 on: August 31, 2009, 08:09:46 pm »
Ahh, glad to have that cleared up. I misinterpreted the way you ran the bot :)

Not sure why you needed to use pconnect as it is discouraged for most usage cases. But given the enviroment you run in, MySQL/PHP settings could be tweaked in a way that does not play too nice with BeBot.

On an somewhat unrelated sidenote, does your webhost really run PHP on their webservers with sockets enabled?  :o
BeBot Founder and Fixer Kingpin

Offline Dochere

  • BeBot User
  • **
  • Posts: 43
  • Karma: +0/-0
Re: BeBot on Linux (newbie)
« Reply #9 on: August 31, 2009, 08:27:48 pm »
Hehe no they dont, i made like 10 support tickets and since iwe been a customer for a few years, and they were allowed to see through what i were doing it was ok :)

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: BeBot on Linux (newbie)
« Reply #10 on: August 31, 2009, 08:56:40 pm »
On an somewhat unrelated sidenote, does your webhost really run PHP on their webservers with sockets enabled?  :o

It is possible to run the Apache PHP module along side the command line PHP interpreter with different configuration files. On my Linux machines, the Apache PHP module deals with any PHP web apps, and command line stuff is dealt with my invoking PHP directly.

Debian and Ubuntu have PHP split up into three parts:
  • php5-cli: PHP5 command line interpreter.
  • php5-cgi: For Apache2 with mod_actions or any other CGI httpd that supports similar mechanism.
  • libapache2-mod-php5: PHP5 module for the Apache 2 webserver.

Each has it's own configuration file. In general, you would have libapache2-mod-php5 and php5-cli installed.

php5-cgi and libapache2-mod-php5 are complied with sockets disabled, but php5-cli has sockets enabled as it's intended for command line use.

Perhaps Dochere's host has a similar configuration, or he got lucky with the support team. :)

 

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


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


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


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 529
  • 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