• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

[FIX] error

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
19 posts • Page 1 of 2 • 1, 2

Postby geomunir » Sat Feb 18, 2006 5:42 am

Hello,
First, really nice script. I've installed it. I installed it in:

domain.com/chat/


Now i'm trying to make a php page with everything same in it in this category:
domain.com/1.php



The only thing i changed in the page is:
Line 2: require_once dirname(__FILE__)."/chat/src/phpfreechat.class.php";


But when i run this page it gives me this error:
PHP Fatal error: Maximum execution time of 90 seconds exceeded in E:Domainsdomain.comwwwrootchatsrcphpfreechattools.class.php on line 45


I have following config:
win 2003
php5
iis6
cgi

yes i do have session properly installed. i also run phpbb.



Thanks in advance.
geomunir
Member
 
Posts: 17
Joined: Sat Feb 18, 2006 5:23 am
Top

Postby geomunir » Sat Feb 18, 2006 5:43 am

i'm running version 0.7.
geomunir
Member
 
Posts: 17
Joined: Sat Feb 18, 2006 5:23 am
Top

Postby geomunir » Sat Feb 18, 2006 6:29 am

anyone there?
geomunir
Member
 
Posts: 17
Joined: Sat Feb 18, 2006 5:23 am
Top

Postby phpfreechat » Sat Feb 18, 2006 10:10 am

It seems your probleme is similar to this one : http://www.phpfreechat.net/forum/viewtopic.php?id=2
Maybe RelativePath($p1, $p2) function is looping indefinitively because of windows paths.

To help debugging :
1 - Could you give me the public url of your installed chat ?
2- Could you post the result of this little script ?
Code: Select all
<?php
 echo "<pre>"; print_r($_SERVER); echo "</pre>";
?>
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby IAmALlama » Sat Feb 18, 2006 10:58 am

in phpfreechattools.class.php when I put "echo $p1;" inside the while loop, i just got this:

C:Documents and SettingsJonathanDesktopwwwrootphpfreechat-0.7demo
C:Documents and SettingsJonathanDesktopwwwrootphpfreechat-0.7
C:Documents and SettingsJonathanDesktopwwwroot
C:Documents and SettingsJonathanDesktop
C:Documents and SettingsJonathan
C:Documents and Settings
C:
C:
C:
C:
.......and about a thousand other c: before the max execution time was hit.

Something like this worked for me::

while(preg_match("/^(D:\|/)?$/", $p1) === TRUE && strpos($p2, $p1) === FALSE){...}

^(D:\|/)?$ = zero or one of either "/" or "(some character not a decimal digit):". That covers /, c:, d:...etc. and blank too.

However after this worked I got another error:

Fatal error: The xajax uncompressed Javascript file could not be found in the ./xajax_js folder. Error in C:Documents and SettingsJonathanDesktopwwwrootphpfreechat-0.7libxajax_0.2_stablexajax.inc.php on line 557

so there might be another problem with that too. If it worked for me, im sure it would be a great program.
IAmALlama
New member
 
Posts: 2
Joined: Sat Feb 18, 2006 10:20 am
Top

Postby geomunir » Sat Feb 18, 2006 4:14 pm

kerphi wrote:It seems your probleme is similar to this one : http://www.phpfreechat.net/forum/viewtopic.php?id=2
Maybe RelativePath($p1, $p2) function is looping indefinitively because of windows paths.

To help debugging :
1 - Could you give me the public url of your installed chat ?
2- Could you post the result of this little script ?
Code: Select all
<?php
 echo "<pre>"; print_r($_SERVER); echo "</pre>";
?>


1.
yeah, here is the public url.
domain.com/chat


The page i tired to put it on is:
domain.com/1.php



2.
What results? Here is the error i get:
PHP Fatal error: Maximum execution time of 90 seconds exceeded in E:Domainsdomain.comwwwrootchatsrcphpfreechattools.class.php on line 45
Last edited by geomunir on Sun Feb 19, 2006 10:43 pm, edited 1 time in total.
geomunir
Member
 
Posts: 17
Joined: Sat Feb 18, 2006 5:23 am
Top

Postby phpfreechat » Sat Feb 18, 2006 4:17 pm

geomunir wrote:2.
What results? Here is the error i get:
PHP Fatal error: Maximum execution time of 90 seconds exceeded in E:Domainsdomain.comwwwrootchatsrcphpfreechattools.class.php on line 45

No, could you create this little script (see bellow) on your server and copy/paste the result ?
Code: Select all
<?php
 echo "<pre>"; print_r($_SERVER); echo "</pre>";
?>
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby geomunir » Sat Feb 18, 2006 5:20 pm

Array
(
[ALLUSERSPROFILE] => C:Documents and SettingsAll Users
[APP_POOL_ID] => ASP2POOL
[ClusterLog] => C:WINDOWSClustercluster.log
[CommonProgramFiles] => C:Program FilesCommon Files
[COMPUTERNAME] => xxxx
[ComSpec] => C:WINDOWSsystem32cmd.exe
[FP_NO_HOST_CHECK] => NO
[MAILENABLE_PATH] => C:PROGRA~1MAILEN~1
[NUMBER_OF_PROCESSORS] => 4
[OS] => Windows_NT
[Path] => C:CFusionMX7verityk2_nti40bin;C:Program FilesMail EnableBIN;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:Program FilesMicrosoft SQL Server80ToolsBinn
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
[PROCESSOR_ARCHITECTURE] => x86
[PROCESSOR_IDENTIFIER] => x86 Family 15 Model 4 Stepping 3, GenuineIntel
[PROCESSOR_LEVEL] => 15
[PROCESSOR_REVISION] => 0403
[ProgramFiles] => C:Program Files
[SystemDrive] => C:
[SystemRoot] => C:WINDOWS
[TEMP] => C:WINDOWSTEMP
[TMP] => C:WINDOWSTEMP
[USERPROFILE] => C:Documents and SettingsDefault User
[VERITY_CFG] => C:CFusionMX7verityk2commonverity.cfg
[windir] => C:WINDOWS
[HTTP_CONNECTION] => Keep-Alive
[HTTP_CONTENT_LENGTH] => 0
[HTTP_ACCEPT] => */*
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_ACCEPT_LANGUAGE] => en-us
[HTTP_COOKIE] => __utma=96792150.1413662714.1139962403.1140278197.1140279060.68; __utmz=96792150.1140051463.18.2.utmccn=(referral)|utmcsr=xxx|utmcct=/journal.php|utmcmd=referral; __utmb=96792150; phpbb2mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A31%3A%225980080743f748e7c21338.86552852%22%3Bs%3A6%3A%22userid%22%3Bi%3A2%3B%7D; phpbb2mysql_sid=345b903784d8179e49182fc7584deeaa
[HTTP_HOST] => domain.com
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
[HTTP_X_REWRITE_URL] => /2.php
[AUTH_TYPE] =>
[AUTH_PASSWORD] =>
[AUTH_USER] =>
[CERT_COOKIE] =>
[CERT_FLAGS] =>
[CERT_ISSUER] =>
[CERT_SERIALNUMBER] =>
[CERT_SUBJECT] =>
[CONTENT_LENGTH] => 0
[CONTENT_TYPE] =>
[GATEWAY_INTERFACE] => CGI/1.1
[HTTPS] => off
[HTTPS_KEYSIZE] =>
[HTTPS_SECRETKEYSIZE] =>
[HTTPS_SERVER_ISSUER] =>
[HTTPS_SERVER_SUBJECT] =>
[INSTANCE_ID] => 4393
[LOCAL_ADDR] => 6xxx
[LOGON_USER] =>
[QUERY_STRING] =>
[REMOTE_ADDR] => xxx
[REMOTE_HOST] => xx
[REMOTE_USER] =>
[REQUEST_METHOD] => GET
[SCRIPT_NAME] => /x.php
[SERVER_NAME] => domain.com
[SERVER_PORT] => 80
[SERVER_PORT_SECURE] => 0
[SERVER_PROTOCOL] => HTTP/1.1
[SERVER_SOFTWARE] => Microsoft-IIS/6.0
[UNMAPPED_REMOTE_USER] =>
[ORIG_PATH_TRANSLATED] => E:Domainsdomain.comwwwroot2.php
[ORIG_PATH_INFO] => /2.php
[ORIG_SCRIPT_NAME] => /2.php
[SCRIPT_FILENAME] => E:Domainsdomain.comwwwrootx.php
[PHP_SELF] => /x.php
[argv] => Array
(
)

[argc] => 0
)
Last edited by geomunir on Sun Feb 19, 2006 10:54 pm, edited 1 time in total.
geomunir
Member
 
Posts: 17
Joined: Sat Feb 18, 2006 5:23 am
Top

Postby bsemf » Sat Feb 18, 2006 6:00 pm

Try this:
Replace line 48 in ~pfc/src/phpfreechattools.class.php
Code: Select all
$p2 = (isset($_SERVER["WINDIR"])) ? str_replace("\","/",substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1))) : substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1));

with
Code: Select all
$p2 = (isset($_SERVER["windir"])) ? str_replace("\","/",substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1))) : substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1));

and Line 61
Code: Select all
$pathA = (isset($_SERVER["WINDIR"])) ? explode('\', $path) : explode('/', $path);

with
Code: Select all
$pathA = (isset($_SERVER["windir"])) ? explode('\', $path) : explode('/', $path);

Then it should work, plz tell me if it does.
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby geomunir » Sat Feb 18, 2006 8:52 pm

bsemf thank you its working.
geomunir
Member
 
Posts: 17
Joined: Sat Feb 18, 2006 5:23 am
Top

Postby geomunir » Sun Feb 19, 2006 8:30 am

is there a way to make a plugin for this script to hook up with phpbb? if the user loged in in phpbb the chat system picks up their user name from db?
geomunir
Member
 
Posts: 17
Joined: Sat Feb 18, 2006 5:23 am
Top

Postby bsemf » Sun Feb 19, 2006 11:18 am

I found a way:

Create a file called *phpbb_tools.php* in your clientfile dir with the following content:
Code: Select all
<?php
function init_sessions ()
   {
   
   global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID, $_SERVER;
   $cookiename = "phpbb2mysql";
   $auto_create = 1;
   $enable_autologin = 1;
   
   
   if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) )
      {
      $session_id = isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
      $sessiondata = isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array();
      $user_id = $sessiondata['userid'];
      }
   else
      {
      $sessiondata = array();
      $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
      }

   //
   if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
      {
      $session_id = '';
      }

   
   
   $last_visit = 0;
   $current_time = time();

   //
   // Are auto-logins allowed?
   // If allow_autologin is not set or is true then they are
   // (same behaviour as old 2.0.x session code)
   //
   if (isset($board_config['allow_autologin']) && !$board_config['allow_autologin'])
      {
      $enable_autologin = $sessiondata['autologinid'] = false;
      }

   //
   // First off attempt to join with the autologin value if we have one
   // If not, just use the user_id value
   //
   $userdata = array();

   if ($user_id != (-1))
      {
      if (isset($sessiondata['autologinid']) && (string) $sessiondata['autologinid'] != '' && $user_id)
         {
         $sql = 'SELECT u.*
            FROM phpbb_users u, phpbb_sessions_keys k
            WHERE u.user_id = ' . (int) $user_id . "
               AND u.user_active = 1
               AND k.user_id = u.user_id
               AND k.key_id = '" . md5($sessiondata['autologinid']) . "'";
         $result = mysql_query($sql);
         

         $userdata = mysql_fetch_assoc($result);
         mysql_freeresult($result);
      
         $enable_autologin = $login = 1;
         }
      else if (!$auto_create)
         {
         $sessiondata['autologinid'] = '';
         $sessiondata['userid'] = $user_id;

         $sql = 'SELECT *
            FROM phpbb_users
            WHERE user_id = ' . (int) $user_id . '
               AND user_active = 1';
         $result = mysql_query($sql);
         

         $userdata = mysql_fetch_assoc($result);
         mysql_freeresult($result);

         $login = 1;
         }
      }
   //
   // At this point either $userdata should be populated or
   // one of the below is true
   // * Key didn't match one in the DB
   // * User does not exist
   // * User is inactive
   //   
   if (!sizeof($userdata) || !is_array($userdata) || !$userdata)
      {
      $sessiondata['autologinid'] = '';
      $sessiondata['userid'] = $user_id = ANONYMOUS;
      $enable_autologin = $login = 0;

      $sql = 'SELECT *
         FROM phpbb_users
         WHERE user_id = ' . (int) $user_id;
      $result = mysql_query($sql);

      $userdata = mysql_fetch_assoc($result);
      mysql_freeresult($result);
      }


   
   $userdata['session_id'] = $session_id;
   $userdata['session_user_id'] = $user_id;
   $userdata['session_logged_in'] = $login;
   $userdata['session_start'] = $current_time;
   $userdata['session_time'] = $current_time;
   $userdata['session_key'] = $sessiondata['autologinid'];
   
   return $userdata;
   }
?>

Then Add as first line in your configfile
Code: Select all
include_once "phpbb_tools.php";
$userdata = init_sessions();

and replace your nickname paramline to
Code: Select all
$params["nick"]          = (isset($userdata['username'])) ? $userdata['username'] : ("guest".rand(1,40));

This Version is for a standalone chatpage, if your want to include the chatscript directly into phpbb you will only need the last step
Last edited by bsemf on Sun Feb 19, 2006 11:19 am, edited 1 time in total.
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Sun Feb 19, 2006 12:40 pm

bsemf, should I modify the official pfc sources like this ? :

Code: Select all
// line 48 in ~pfc/src/phpfreechattools.class.php :
$p2 = (isset($_SERVER["windir"]) || isset($_SERVER["WINDIR"])) ? str_replace("\","/",substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1))) : substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1));

// Line 61
$pathA = (isset($_SERVER["windir"]) || isset($_SERVER["WINDIR"])) ? explode('\', $path) : explode('/', $path);
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bsemf » Sun Feb 19, 2006 4:19 pm

Yes I think that would be better.
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Sun Feb 19, 2006 5:44 pm

Ok I've done the modif
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Next

Post a reply
19 posts • Page 1 of 2 • 1, 2

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 11 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub