• 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

PHP safe mode

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

Post a reply
10 posts • Page 1 of 1

Postby Xavier » Tue Apr 04, 2006 3:54 am

Am I correct in assuming that phpFreeChat does not work in safe mode? Running the script seems to generate a lot of errors related to file operations. Is there a way to work around this?
Xavier
New member
 
Posts: 3
Joined: Tue Apr 04, 2006 3:18 am
Top

Postby phpfreechat » Tue Apr 04, 2006 7:55 am

Yes it's known pfc has problems with "safe_mode=On"
I don't have time to look at workerounds but I will be pleased to integrate any patch attempt to fix this problem.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Xavier » Tue Apr 04, 2006 6:56 pm

I'll take a look, but if the script relies heavily on file operations there isn't much I can do. Too bad, this is by far the most promising chat script I've seen.

Anyway, I'd suggest adding a mention about safe mode to the required configuration page.
Xavier
New member
 
Posts: 3
Joined: Tue Apr 04, 2006 3:18 am
Top

Postby phpfreechat » Tue Apr 04, 2006 7:20 pm

Could you test the Memory container ? (demo35)
maybe it works better with safe_mode enable
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby phpfreechat » Tue Apr 04, 2006 7:35 pm

I just tested the chat with safe_mode enable on my localhost.
It works but I need to give all scripts the servers "user:group" rights.

On my debian I typed these lines to install the chat :
Code: Select all
cd ~/public_html/tmp/
wget http://www.phpfreechat.net/download/phpfreechat-0.9.1.tar.gz
tar xzf phpfreechat-0.9.1.tar.gz
chown -R www-data:www-data phpfreechat-0.9.1

Then I just browsed to my localhost url : http://localhost/~kerphi/tmp/phpfreechat-0.9.1/

It works well without any warnings or errors ...

However the shared memory container doesn't works well because of my local pear installation, I got :

Warning: main(): SAFE MODE Restriction in effect. The script whose uid is 33 is not allowed to access /usr/share/php/PEAR.php owned by uid 0 in /home/kerphi/public_html/tmp/phpfreechat-0.9.1/lib/pear/System/SharedMemory/Shmop.php on line 41

Warning: main(PEAR.php): failed to open stream: No such file or directory in /home/kerphi/public_html/tmp/phpfreechat-0.9.1/lib/pear/System/SharedMemory/Shmop.php on line 41

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/kerphi/public_html/tmp/phpfreechat-0.9.1/lib/pear/System/SharedMemory/Shmop.php on line 41


Hope that helps.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Xavier » Tue Apr 04, 2006 9:43 pm

Yes, that would probably to the trick, but unfortunately I'm not a root user so chown is out of the question. :(

I tried to recreate the directory structure manually, but the script kept dying with:

Warning: main(): Unable to access xajaxResponse.inc.php in lib/xajax_0.2.3/xajax.inc.php on line 39

Warning: main(xajaxResponse.inc.php): failed to open stream: No such file or directory in lib/xajax_0.2.3/xajax.inc.php on line 39

Fatal error: main(): Failed opening required 'xajaxResponse.inc.php' (include_path='') in lib/xajax_0.2.3/xajax.inc.php on line 39

...until I fixed the require_once("xajaxResponse.inc.php"); by entering the full path of the xajaxResponse.inc.php file. Works like a charm. Yay! :cool:
Xavier
New member
 
Posts: 3
Joined: Tue Apr 04, 2006 3:18 am
Top

Postby phpfreechat » Tue Apr 04, 2006 10:16 pm

Ok thank you for the tip, I integrated this patch to the pfc source code :
Code: Select all
Modified: trunk/lib/xajax_0.2.3/xajax.inc.php
==============================================================================
--- trunk/lib/xajax_0.2.3/xajax.inc.php (original)
+++ trunk/lib/xajax_0.2.3/xajax.inc.php Tue Apr  4 23:09:50 2006
@@ -36,7 +36,7 @@
       define ('XAJAX_DEFAULT_CHAR_ENCODING', 'utf-8' );
 }

-require_once("xajaxResponse.inc.php");
+require_once(dirname(__FILE__)."/xajaxResponse.inc.php");

 // Communication Method Defines
 if (!defined ('XAJAX_GET'))
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby motosdeagua.es » Tue May 02, 2006 12:44 pm

my server does not have deactivated "safe mode", I have option to use this chat anyway?

Tnx!
My challenge is make working to phpfreechat with postnuke!
Moving phpfreechat to Spain!
- www.motosdeagua.es -
motosdeagua.es
Member
 
Posts: 35
Joined: Tue May 02, 2006 12:24 pm
Location: SPAIN
  • Website
Top

Postby phpfreechat » Tue May 02, 2006 2:04 pm

Just try, in certain configuration pfc will works (when I enable safe_mode on my localhost, I don't have any problems) but on some strange configuration it doesn't works ...
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby motosdeagua.es » Tue May 02, 2006 5:07 pm

ERROR -->> http://www.motosdeagua.es/modules/chat/index.php :(:(
My challenge is make working to phpfreechat with postnuke!
Moving phpfreechat to Spain!
- www.motosdeagua.es -
motosdeagua.es
Member
 
Posts: 35
Joined: Tue May 02, 2006 12:24 pm
Location: SPAIN
  • Website
Top


Post a reply
10 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 9 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