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: passed by reference error on Ubuntu 5.10  (Read 5352 times)

0 Members and 1 Guest are viewing this topic.

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« on: November 29, 2005, 09:34:40 am »
I run Ubuntu 5.10 and BeBot v0.2.11 and folowed this guide as closely as possible but when I run the bot I get errors and bot tries to load again.

Fatal error: Only variables can be passed by reference in /home/johskar/BeBot/bebot/AOChat.php on line 880

with the AOChat.php wich came with the bot and PHP4/5 and same msg with the new AOChat.php and PHP4/5
I haven't modified the bot in anny way except setting it up to use my account and avartar.

Anny tips on how to fix this? as I realy would like to get the bot up and running(preferably on PHP5).

Also; is there a newer version out there?

Ok, found v0.3.0, but same error here too( online 850) now.
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
passed by reference error on Ubuntu 5.10
« Reply #1 on: November 29, 2005, 09:57:11 am »
Split this post out from the thread as its really a support request with a valid problem.

Could you post your php.ini (/etc/php.ini normally) and also give us the exact version numbers of the PHP installs you tested with?

If your feeling adventurous and know how to edit MySQL databases you can take a look at the current development release:
http://bebot.fieses.net/viewtopic.php?t=147

If your feeling particularly brave you can also grab the very latest subversion, which is essentially the same code as im running on my testing bots.
Caveat empor. This code CAN be completely broken at times, especially as i use SVN to committ untested changes for testing on various bots.
This provides you have subversion installed:
svn co http://svn.shadow-realm.org:7100/svn/BeBot/trunk BeBot
BeBot Founder and Fixer Kingpin

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #2 on: November 29, 2005, 10:09:49 am »
PHP 4.4.0-3 (cli) (built: Oct  8 2005 18:59:42)
and
PHP 5.0.5-2ubuntu1 (cli) (built: Oct  8 2005 23:17:38)
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #3 on: November 29, 2005, 10:11:58 am »
PHP5 php.ini file
Code: [Select]

[PHP]


; Misc
;
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header).  It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
expose_php = On


;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 32M      ; Maximum amount of memory a script may consume (8MB)
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
include_path = ".:/usr/share/php"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
doc_root =

; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
; extension_dir = "./"

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
enable_dl = On

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1

; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request.
; cgi.nph = 1

; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
; will look for to know it is OK to continue execution.  Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
; cgi.redirect_status_env = ;

; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
; security tokens of the calling client.  This allows IIS to define the
; security context that the request runs under.  mod_fastcgi under Apache
; does not currently support this feature (03/17/2002)
; Set to 1 if running under IIS.  Default is zero.
; fastcgi.impersonate = 1;

; Disable logging through FastCGI connection
; fastcgi.log = 0

; cgi.rfc2616_headers configuration option tells PHP what type of headers to
; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
; is supported by Apache. When this option is set to 1 PHP will send
; RFC2616 compliant header.
; Default is zero.
;cgi.rfc2616_headers = 0

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Define the anonymous ftp password (your email address)
;from="[email protected]"

; Define the User-Agent string
; user_agent="PHP"

; Default timeout for socket based streams (seconds)
default_socket_timeout = 60

; If your scripts have to deal with files from Macintosh systems,
; or you are running on a Mac and need to deal with files from
; unix or win32 systems, setting this flag will cause PHP to
; automatically detect the EOL character in those files so that
; fgets() and file() will work regardless of the source of the file.
; auto_detect_line_endings = Off


;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.


; Example lines:

;extension=mysql.so
;extension=gd.so

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
; runtime, you can define these variables by calling define_syslog_variables().
define_syslog_variables  = Off

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

[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 secondes) 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

; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.

; This is disabled in the Debian packages, due to the strict permissions
; on /var/lib/php5.  Instead of setting this here, see the cronjob at
; /etc/cron.d/php5, which uses the session.gc_maxlifetime setting below
;session.gc_probability = 0
session.gc_divisor     = 100

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; NOTE: If you are using the subdirectory option for storing session files
;       (see session.save_path above), then garbage collection does *not*
;       happen automatically.  You will need to do your own garbage
;       collection through a shell script, cron entry, or some other method.
;       For example, the following script would is the equivalent of
;       setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
;          cd /path/to/sessions; find -cmin +24 | xargs rm

; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, albeit register_globals
; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled.

session.bug_compat_42 = 1
session.bug_compat_warn = 1

; Local Variables:
; tab-width: 4
; End:
extension=curl.so
extension=gd.so
extension=imap.so
extension=ldap.so
extension=mhash.so
extension=mysql.so
extension=recode.so
extension=snmp.so
;extension=sqlite.so
;extension=sybase_ct.so
extension=xmlrpc.so
extension=xsl.so

"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #4 on: November 29, 2005, 12:00:07 pm »
Just a Tip.
Unless your running other PHP enabled services (aka Apache Web server) you can pretty much kill that php.ini to the following lines for Bebot.
Code: [Select]

extension_dir = "./"

extension=php_bz2.so
extension=mysql.so
extension=php_sockets.so


Letting PHP use it's defaults for everything else if only running a Bot.
<<< Hack's in Zend Studio

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

Offline Akarah

  • Contributor
  • *******
  • Posts: 72
  • Karma: +0/-0
    • http://synergyfactor.net/
passed by reference error on Ubuntu 5.10
« Reply #5 on: November 29, 2005, 12:14:59 pm »
which php is bebot actually using? should focus on one then figure out the issue from there ;)

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #6 on: November 29, 2005, 12:36:51 pm »
Wich php?
I tried both PHP4 and PHP5

Yes I run Apache2 with PHP extensions on the same machine.

Should copy the listed modules to the bot dir, create my own php.ini there and use that one then?
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #7 on: November 29, 2005, 02:11:10 pm »
Quote from: "johskar"
Should copy the listed modules to the bot dir, create my own php.ini there and use that one then?


Ya I'd try a localized(to the bot) php.ini... should eliminate the Global php.ini from clashing with  it. You can always set the path to the extensions dir. in the localized copy so you don't have multiple copies floating around your box.
<<< Hack's in Zend Studio

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

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #8 on: December 01, 2005, 12:48:31 am »
Found the file
  mysql.so

but I can't seem to locate the files
  php_bz2.so
  php_sockets.so

with the following in my php.ini
  extension=php_bz2.so
  extension=mysql.so
  extension=php_sockets.so
it get's error on loading php_bz2.so and php_sockets.so

Here is what happens when loading without php_bz2.so and php_sockets.so
Code: [Select]
$ php ./start.php
[2005-12-01 00:12:06]   [CORE]  [LOAD]  BotHelp.php
[2005-12-01 00:12:06]   [CORE]  [LOAD]  Que.php
[2005-12-01 00:12:06]   [CORE]  [LOAD]  RightsManagement.php
[2005-12-01 00:12:07]   [CORE]  [LOAD]  Alts.php
[2005-12-01 00:12:07]   [CORE]  [LOAD]  Online.php


 (Duplicate entry '3' for key 1)



[2005-12-01 00:12:07]   [CORE]  [LOAD]  Admin.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Rules_RAID.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  PrivGroup.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  RaidTime.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Raffle.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  PB.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  AFK.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  History.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Raids.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Calc.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Oe.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Roll.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Blacklist.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  MassMsg.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  About.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Is.php
[2005-12-01 00:12:07]   [MOD]   [LOAD]  Points.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  IRC.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  AutoMsg.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Items.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Glyph_RAID.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Rally.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Callers.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Tier2.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  TowerAttack.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Whois.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Rooster_RAID.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Bid.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Time.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Settings.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Server.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Level.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Bio.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Teams.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  Shutdown.php
[2005-12-01 00:12:08]   [MOD]   [LOAD]  News.php
[2005-12-01 00:12:09]   [MOD]   [LOAD]  Countdown.php
 [2005-12-01 00:12:09]  [MOD]   [LOAD]  AutoInv.php
[2005-12-01 00:12:09]   [MOD]   [LOAD]  Target.php
[2005-12-01 00:12:09]   [LOGIN] [STATUS]        Connecting

Fatal error: Only variables can be passed by reference in /home/johskar/BeBot/BeBot/AOChat.php on line 903
[2005-12-01 00:12:10]   [CORE]  [LOAD]  BotHelp.php
[2005-12-01 00:12:10]   [CORE]  [LOAD]  Que.php
[2005-12-01 00:12:10]   [CORE]  [LOAD]  RightsManagement.php
[2005-12-01 00:12:11]   [CORE]  [LOAD]  Alts.php
[2005-12-01 00:12:11]   [CORE]  [LOAD]  Online.php
(Bot killed by me here cause it enters an infinite loop)

Note: this is using latest release from subversion with latest AOChat.php from Auno, same error on all versions of bot and AOChat.php, as I all I could find :/
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #9 on: December 01, 2005, 01:20:11 am »
according to '$ php -m' is bz2 and sockets built into the core of php now it seems.
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
passed by reference error on Ubuntu 5.10
« Reply #10 on: December 01, 2005, 01:23:11 pm »
On Linux, most modules are usually in the php core, at least with php4. Ive never used Ubuntu though so i cant say.

The error doesnt make much sense to me, and due to the point in the code where it happens, im starting to wonder if there could be something wrong with your Bot.conf settings making it pass something strange.

Just a question, did you modify AOChat.php in any way to remove the sockets extention check?

You can also for the record force php to use a different php ini file by editing start.php (although while testing this, you can bypass start.php entirely and launch the bot using the main.php file to avoid the looping spam)
php -c /path/to/php.ini main.php
BeBot Founder and Fixer Kingpin

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #11 on: December 01, 2005, 03:27:52 pm »
Did not modify AOChat.php in anny way to remove the socket extension check.

My Bot.conf file(scrambled uname/pwd):
Code: [Select]
<?
  /*
    These are the general settings of the bot:
  */

  $ao_username = "********";               // Account username
  $ao_password = "********";               // Account password
  $bot_name = "Jointstrike";                  // Name of the bot-character
  $dimension = "2";                // Dimension number (1, 2 or 3)


  $super_admin["Heffalomp"] = true;// Bot superadmins
  $super_admin["Betadoc"] = true;


  $other_bots["Protocoll6"] = true;   // All other bots that are guildmembers/raidbotmembers
  $other_bots["Experimentus"] = true;
  $other_bots["Offtheedge"] = true;

  $guildbot = false;                // false if its a raidbot.
  $guild_name = "";                // only if its a guildbot.
  $guild_id = 00000001;            // only if its a guildbot.
  $guild_relay_target = "Protocoll6"; // False if you dont want a relay bot, set to target bots name otherwise.


  $tell_color = "#dddddd";         // Color of a standard tell.
  $group_color = "#abd95b";        // Color of a group message (Guildchat and privategroup).


  $log = "chat";                     // logging all/chat/off
  $log_path = "./log";             // relative/absolut path of logfiles


  $command_prefix = "!";          // Please make sure this is in a Reg-Exp format... (exampe: for "." use "\.")


  $cron_delay = 30;                // Number of seconds before the cron jobs get executed the first time.
  $tell_delay = 2222;              // Number of miliseconds between tells. (anti-flooding)
  $reconnect_time = 60;            // Time to wait for auto reconnect after an error has accured.
  $max_blobsize = 5500;            // Maximum size of text blobs in byte.
?>
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

Offline Akarah

  • Contributor
  • *******
  • Posts: 72
  • Karma: +0/-0
    • http://synergyfactor.net/
passed by reference error on Ubuntu 5.10
« Reply #12 on: December 01, 2005, 03:42:14 pm »
the long posts containing 2 different php.ini's make this thread exceedingly difficult to view.

it still sounds to me like there's a php4/5 compatibility issue you're running into.

long story short, if all else fails, compile php 4.4.0 from scratch with --prefix=$HOME, make install it there, call it as ~/bin/php and make sure you start from scratch with the bot.

remember if you were using a version of bebot prior to 0.3.x there are some database changes that needed to be done before upgrading. if you're not comfortable with that, dropping your bebot database and recreating it (at the same time as starting over with a fresh install of the bot) could help as well.

Offline Akarah

  • Contributor
  • *******
  • Posts: 72
  • Karma: +0/-0
    • http://synergyfactor.net/
passed by reference error on Ubuntu 5.10
« Reply #13 on: December 01, 2005, 03:42:44 pm »
i would love for this thread to have a page 2, so i don't have to scroll down so much to read new replies! omg

Offline Heffalomp

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
passed by reference error on Ubuntu 5.10
« Reply #14 on: December 01, 2005, 03:57:16 pm »
Quote from: "Akarah"
the long posts containing 2 different php.ini's make this thread exceedingly difficult to view.

I'll remove them, and insert the one I am running now instead :)
"Ubuntu" is an ancient African word, meaning "I can't configure Slackware"

 

* 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: 392
  • 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