Koozali.org: home of the SME Server

Session.save_path problems

Offline madadam

  • *
  • 149
  • +0/-0
    • http://www.extremetourist.com
Session.save_path problems
« on: March 28, 2004, 04:11:09 AM »
I recently installed a very useful, well written and implemented PHP script called PHPLive which allows customers to see you online on your website and request to chat live without large Javascript consoles - this is by far the best implementation of this type of product I have seen.

But I have a problem...the installation script claims I have not set my Session.save_path, which is not true, it is set in the PHP.INI file to the default of /tmp.

Their code goes like this:

if ( !is_dir( session_save_path() ) ) {
  print "<font color=\"#FF0000\">'session.save_path' directory not set!  Please set your session.save_path in your php.ini file.  It is usally set to /tmp for UNIX, C:\Temp for windows. After you have done this, reload this page.</font><br>" ;
  print "currently: ".session_save_path();      
  exit ;
}

Can anyone suggest why it might be giving this error?

Cheers,

Adam
...

eekb

Session.save_path problems
« Reply #1 on: March 28, 2004, 05:19:49 PM »
I have the same problem. TikiWiki says:
The directory '/tmp' does not exist or PHP is not allowed to access it (check open_basedir entry in php.ini).

And moodle says:
Warning: It appears your server does not support sessions (session.save_path = '/tmp')

After upgrading PHP to PHP4.3.4

And I have also set my /temp in php.ini.

Did you already solve the problem?
I hope someone can help us.

Igor

Anonymous

Session.save_path problems
« Reply #2 on: March 28, 2004, 05:27:44 PM »
After doing some digging I found that it is a problem related to the open_basedir setting in the php.ini file. The open_basedir sets the lowest directory level thatr PHP can access relative to the position of the executing PHP file. Some setups have the open_basedir setting set to / but I couldn't find any setting for it, I did a phpinfo and found that the global setting is not set but somewhere a local setting is made.

I have fixed it in a manner that works for me. I have edited the httpd.conf file (as a custom template of course) to change the AllowOverride NONE setting to AllowOverride ALL in the ibays and have set the php parameters in a .htaccess file.

If you need help on doing this let me know.

eekb

Session.save_path problems
« Reply #3 on: March 28, 2004, 05:40:17 PM »
Thx for replying that quick.

I wonder if you could tell me what custom-template I have to edit and what lines.
And maybe also what to put in the .htaccess.

I already began searching in the 90e-smithAccess40ibays file but I coulden't find it.

I hope you can help me again,

Igor

eekb

Session.save_path problems
« Reply #4 on: March 28, 2004, 05:53:40 PM »
I did some digging too and came up with something from the TikiWiki install file:

enter this in the console and replace the <ibayname> for you're own ibayname:

/sbin/e-smith/db accounts setprop <ibayname> PHPBaseDir /
/sbin/e-smith/signal-event ibay-modify <ibayname>

This works for me! But still I am interested what you came up with.

Igor

excalibur

PHP Sessions not working
« Reply #5 on: July 08, 2004, 11:05:26 AM »
I am trying to get PHP Gallery 1.4.3 working (this rpm gallery-1.4.3-pl2). I know from their FAQ that I have a PHP session error.

I'm running a SME 6.0 box.

Above solution does not work for me. When I try it in a console I get this error (hobbies is name of my ibay):
# /sbin/e-smith/db accounts setprop <hobbies> PHPBaseDir /
bash: hobbies: No such file or directory


Any help here?

Thanks

Morten

deunan

Re: PHP Sessions not working
« Reply #6 on: July 11, 2004, 09:05:30 AM »
Quote from: "excalibur"

Above solution does not work for me. When I try it in a console I get this error (hobbies is name of my ibay):
# /sbin/e-smith/db accounts setprop <hobbies> PHPBaseDir /
bash: hobbies: No such file or directory


Quite possibly that you have typed "<hobbies>", where as it should be just plain "hobbies"

It happens sometimes...  ;-)

Regards

DK

deunan

Session.save_path problems
« Reply #7 on: July 11, 2004, 09:12:06 AM »
Quote from: "eekb"
I did some digging too and came up with something from the TikiWiki install file:

enter this in the console and replace the <ibayname> for you're own ibayname:

/sbin/e-smith/db accounts setprop <ibayname> PHPBaseDir /
/sbin/e-smith/signal-event ibay-modify <ibayname>

This works for me! But still I am interested what you came up with.

Igor


Well, that didn't work..  After applying the above solution, when I try to access the ibay, the whole page vanished..  Panicked for a few minutes.. :-o

Had to manually edit out the "PHPBaseDir /" from /home/e-smith/accounts file then send back the "/sbin/e-smith/signal-event ibay-modify <ibayname>"

Sweated a bit over that... :oops:


Best Regards

DK

deunan

Session.save_path problems
« Reply #8 on: July 11, 2004, 09:25:40 AM »
Okies...

Previously, when it was running on just plain 'ol SME 6.0.1-01, everything works beautifully..  with PHP4.12 of course..

But I wanted to install PHProjekt, it was recommended to me to have PHP4.2.x  . I followed the instructions from these links -

PHP 4.3.7

Script 4th July, RPMs 13th June
http://forums.contribs.org/index.php?topic=22754.0
http://ergin.dyndns.org/download/php4.3.7-upgrade.sh
http://www.ibiblio.org/pub/linux/distributions/e-smith/contrib/DanBrown/RPMS/i386/

and now, the "session.save_path" appears to be broke.

I've made sure that the "session.save_path = /tmp" and also the /tmp in the root of SME is set to 777.  I've even created a separate /wwwphptmp with ownership and groupowner to www.  Strangest part that, the sessions still goes back to /tmp.

Once I deleted the tmpsessions file inside the /tmp, the file got recreated back again..  the contents of the file said such -

session_ok|i:1;session_test|s:6:"failed";

Apparently written by the env_test.php from PHProjekt.

I believe the problem lies not with PHProjekt but the settings of SME somewhere.  This happens only after I upgraded the PHP from the vanilla 4.1.2 to 4.3.7

Assistance urgently requested!  Will be very much appreciated!!


Sincere regards and thanks!

DK

deunan

Session.save_path problems
« Reply #9 on: July 22, 2004, 08:42:25 AM »
okies..

I managed to solve the problem..

As I mentioned earlier, I tried the solution suggested by eekb -

Code: [Select]

/sbin/e-smith/db accounts setprop <ibayname> PHPBaseDir /
/sbin/e-smith/signal-event ibay-modify <ibayname>



but somehow or rather, it didn't work..  My ibay directory displays plain white wallpaper in my web browser..  After some hacking, I managed to solve this issue by slightly improving eekb's code thus -

Code: [Select]

/sbin/e-smith/db accounts setprop <ibayname> PHPBaseDir /home/e-smith/files/ibays/<ibayname>/:/tmp
/sbin/e-smith/signal-event ibay-modify <ibayname>



As you noticed the colon (:) between the two directories.  This is to signify that there's a multiple directory (two to be exact) being specified so that PHP can executes stuff in the ibay's directory and also inside /tmp.  Therefore no compromise to security and also solves the white wallpaper issue that I encountered earlier.

It seems that, there's a certain depth of directories that PHP defaults to in executing the scripts and apparently the ibays' directory seems to be too deep in order to put the PHPBasedir to /, thus explains the white wallpaper that I encountered. Actually, as I recall, there is a way to specify how deep the directories that PHP can executes from, but :pint: let's leave that for later..  Now, I need some aspirin and a cute doctor to call in the morning 8-) )

Anyway, by specifying two separate directories seems to solve the problem.

I hope my solution is the proper way of doing things.  Anyone else who can improve my solutions, please...  I'm all ears..  ;-)


Sincere regards and thanks

Deunan

organetic

Session.save_path /tmp problem ALREADY SOLVED???
« Reply #10 on: September 22, 2004, 02:55:09 PM »
Hi fellows,

Is this the real solution? I mean, I have to do this for each ibay, isn't it?

Please tell me if this is the way to go because I'm ready to upgrade my PHP to 4.3.8 tomorrow...

Best regards,
Organetic

Medimo

Session.save_path problems
« Reply #11 on: September 22, 2004, 04:50:01 PM »
Hi,

I had the same problem with the include patch of PHP in the ibays. I found that actually SME has set it it up very nicely.

All ibays are set to there own 'sandboxes'
PHP is not allowed outside the sandbox, so not to /tmp or /usr/share. This is a security measure.

PHP values are set per ibay in the template:
/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays

There you can set the basedir (or the includedir) for all ibays by changing the template.

I changed the template to use $ibaydir/include as the sandbox for including files. In my $ibaydir I therefore have cgi-bin,files,html and include.

This way you can keep your files clean and together.

grz,

Medimo

organetic

Session.save_path problems
« Reply #12 on: September 22, 2004, 09:24:46 PM »
So, let me see if I understand. After upgrading PHP using php4.3.8-upgrade.sh script all I have to do is to edit the file and in front of the "basedir" statement and state something like "/tmp", this way I have the session.save_path question resolved.

Is this procedure right?

Thanks for you attention and sorry for me beeing so dummy  :hammer:

Best regards!

Offline Rebels

  • 13
  • +0/-0
Medimo, can you show the exactly code of the template?
« Reply #13 on: May 06, 2005, 01:42:03 PM »
Can you mail the exact code of the changes you made to the template?

Perhaps the whole file?

Thanx.

Eric
...

crow

Session.save_path problems
« Reply #14 on: October 06, 2006, 04:21:40 PM »
I had the vanishing site problem too. Found this on another post and it works for me (egroupware being the ibay)

/sbin/e-smith/db accounts setprop egroupware PHPBaseDir /home/e-smith/files/ibays/egroupware/:/tmp
/sbin/e-smith/signal-event ibay-modify egroupware