• 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] Problems on windows servers

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

Post a reply
13 posts • Page 1 of 1

Postby bsemf » Thu Feb 09, 2006 9:26 pm

Hi,

First I wanna say: Great Chat, I've never seen such a nice ajax chat.:)

My Problem:
I'm running a windows 2003 server with apache 2.2 and php5.
Still 0.6 makes problems with the RelativePath function.

I just wanted to post that problem, I don't know you already know this bug.
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Thu Feb 09, 2006 9:30 pm

Could you post the result of this little script ?
Code: Select all
<?php
 echo "<pre>"; print_r($_SERVER); echo "</pre>";
?>

it will help to understand why the relative path is wrong.

Moreover, do you have :
1. URL RewritingRules for the chat in your Apache configuration ?
2. Do you have a CGI installation of php ?
(I know pfc makes problems on such configs)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bsemf » Thu Feb 09, 2006 9:34 pm

Here you are:
Array
(
[HTTP_HOST] => localhost
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
[HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
[HTTP_ACCEPT_LANGUAGE] => de,de-de;q=0.8,en;q=0.5,en-us;q=0.3
[HTTP_ACCEPT_ENCODING] => gzip,deflate
[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
[HTTP_KEEP_ALIVE] => 300
[HTTP_CONNECTION] => keep-alive
[HTTP_COOKIE] => ***
[HTTP_CACHE_CONTROL] => max-age=0
[PATH] => C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:ProgrammeBonjour;C:ProgrammeQuickTimeQTSystem;C:ProgrammeQEMU;C:ProgrammeGemeinsame DateienGTK2.0bin;C:ProgrammeMicrosoft Command Shell
[SystemRoot] => C:WINDOWS
[COMSPEC] => C:WINDOWSsystem32cmd.exe
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.pyo;.pyc;.pyw;.py
[WINDIR] => C:WINDOWS
[SERVER_SIGNATURE] =>
Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/5.1.1 Server at localhost Port 80


[SERVER_SOFTWARE] => Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/5.1.1
[SERVER_NAME] => localhost
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => C:/Programme/xampp/htdocs
[SERVER_ADMIN] => admin@localhost
[SCRIPT_FILENAME] => C:/Programme/xampp/htdocs/test.php
[REMOTE_PORT] => 2256
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] =>
[REQUEST_URI] => /test.php
[SCRIPT_NAME] => /test.php
[PHP_SELF] => /test.php
[REQUEST_TIME] => 1139517152
[argv] => Array
(
)

[argc] => 0
)

I have ModRewrite ON but I don't use it within the chat.
My PHP is running as mod_php for apache
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Thu Feb 09, 2006 9:41 pm

Code: Select all
[SCRIPT_FILENAME] => C:/Programme/xampp/htdocs/test.php

Seems to be correct.

Could you copy/paste the error message you get ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bsemf » Thu Feb 09, 2006 9:45 pm

My error I get with demo1:
Fatal error: Maximum execution time of 60 seconds exceeded in C:Programmexampphtdocsphpfreechat-0.6srcphpfreechattools.class.php on line 40

I think the while expression causes that error
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Thu Feb 09, 2006 10:07 pm

Line 40 is :
Code: Select all
if(session_id() == "") session_start();

it seems you have a problem with your sessions.

Does session_id and session_start exists on your system ?

try this script to know:
Code: Select all
<?php
if (!function_exists("session_id")) echo "session_id doesn't exists!";
if (!function_exists("session_start")) echo "session_start doesn't exists!";
?>

Maybe there is a mistake in your php.ini config about sessions ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bsemf » Thu Feb 09, 2006 10:13 pm

Sessions are all fine, I use a phpBB2 Forum and there are no problems, the problem is the while clause in this function

Code: Select all
function RelativePath($p1, $p2)
  {
    if (is_file($p1)) $p1 = dirname($p1);
    if (is_file($p2)) $p2 = dirname($p2);
    // using realpath function is necessary to resolve symbolic links
    $p1 = realpath(phpFreeChatTools::CleanPath($p1));
    $p2 = realpath(phpFreeChatTools::CleanPath($p2));
    $res = "";
    while( $p1 != "" && $p1 != "/" && strpos($p2, $p1) === FALSE)
    {
      $res .= "../";
      $p1 = dirname($p1);
    }
    $p2 = substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1));
    $res .= $p2;
    // remove the last "/"
    if (preg_match("/.*/$/", $res)) $res = preg_replace("/(.*)//","$1",$res);
    // if rootpath is empty replace it by "." to avoide url starting with "/"
    if ($res == "") $res = ".";
    return $res;
  }

I tried to replace the while clause with serveral IF ones, and it didn't work either but the script finished.

Then this error comes:
Code: Select all
Fatal error: The xajax uncompressed Javascript file could not be found in the ./data/public//xajax_js folder. Error in C:Programmexampphtdocsphpfreechat-0.6libxajax_0.2_stablexajax.inc.php on line 557
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Thu Feb 09, 2006 11:42 pm

Ok thanks!
I based this method on unix standard : with "/" separator.

It will be hard for me to debug because I don't have a windows platform...
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bsemf » Fri Feb 10, 2006 7:16 am

I can give you ftp access just write me an e-mail.

bsemfger <at> aim.com

btw: Are you planning to make this chat multi-language enabled?? With language files? I could translate them an the Homepage into german, just please give the files or tell me where I do find them.
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Fri Feb 10, 2006 10:00 am

bsemf wrote:I can give you ftp access just write me an e-mail.

bsemfger <at> aim.com

I don't have time for now but I will contact you when I have a minute.


bsemf wrote:btw: Are you planning to make this chat multi-language enabled?? With language files? I could translate them an the Homepage into german, just please give the files or tell me where I do find them.

Yes, this is exactly on what I'm working today.
Wait for 0.7 release it will include multi-language labels.

About the homepage (overview, install, customize) I really interested by any translations.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bsemf » Mon Feb 13, 2006 4:04 pm

I now manged to fix this bug
Code: Select all
function RelativePath($p1, $p2)
  {
    if (is_file($p1)) $p1 = dirname($p1);
    if (is_file($p2)) $p2 = dirname($p2);
    // using realpath function is necessary to resolve symbolic links
    $p1 = realpath(phpFreeChatTools::CleanPath($p1));
      $p2 = realpath(phpFreeChatTools::CleanPath($p2));
    $res = "";
    while( $p1 != "" && $p1 != "/" && strpos($p2, $p1) === FALSE)
    {
      $res .= "../";
      $p1 = dirname($p1);
    }
    $p2 = (isset($_SERVER["WINDIR"])) ? str_replace("\","/",substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1))) : substr($p2, strlen($p1)+1, strlen($p2)-strlen($p1));
    $res .= $p2;echo "<br>n";
    // remove the last "/"
    if (preg_match("/.*/$/", $res)) $res = preg_replace("/(.*)//","$1",$res);
    // if rootpath is empty replace it by "." to avoide url starting with "/"
    if ($res == "") $res = ".";
    return $res;
  }

  function CleanPath($path)
  {
    $result = array();
    // $pathA = preg_split('/[/\]/', $path);
    $pathA = (isset($_SERVER["WINDIR"])) ? explode('\', $path) : explode('/', $path);
    if (!$pathA[0])
      $result[] = '';
    foreach ($pathA AS $key => $dir) {
      if ($dir == '..') {
        if (end($result) == '..') {
          $result[] = '..';
        } elseif (!array_pop($result)) {
          $result[] = '..';
        }
      } elseif ($dir && $dir != '.') {
        $result[] = $dir;
      }
    }
    if (!end($pathA))
      $result[] = '';
    return implode('/', $result);
  }

And in the pfc.class.php
Replace line 81 with
Code: Select all
$xajax_js = (isset($_SERVER["WINDIR"])) ? phpFreeChatTools::RelativePath(phpFreeChatTools::GetScriptFilename(), $c->data_public."/") : $c->rootpath.'/data/public/';
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby phpfreechat » Tue Feb 14, 2006 11:11 am

Thank you, I just integrated your patch.
It seems to work on linux so congratulation :D
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby bsemf » Tue Feb 14, 2006 11:11 am

thx
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top


Post a reply
13 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 12 guests

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