Koozali.org formerly Contribs.org

Legacy Forums => Experienced User Forum => Topic started by: madadam on March 28, 2004, 04:11:09 AM

Title: Session.save_path problems
Post by: madadam 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
Title: Session.save_path problems
Post by: eekb 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
Title: Session.save_path problems
Post by: Anonymous 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.
Title: Session.save_path problems
Post by: eekb 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
Title: Session.save_path problems
Post by: eekb 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
Title: PHP Sessions not working
Post by: excalibur 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
Title: Re: PHP Sessions not working
Post by: deunan 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
Title: Session.save_path problems
Post by: deunan 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
Title: Session.save_path problems
Post by: deunan 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
Title: Session.save_path problems
Post by: deunan 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
Title: Session.save_path /tmp problem ALREADY SOLVED???
Post by: organetic 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
Title: Session.save_path problems
Post by: Medimo 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
Title: Session.save_path problems
Post by: organetic 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!
Title: Medimo, can you show the exactly code of the template?
Post by: Rebels 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
Title: Session.save_path problems
Post by: crow 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
Title: Reopending old post here.
Post by: Agent86 on May 12, 2007, 08:39:02 PM
Quote from: "deunan"
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


Does anyone know if these types of steps are still needed in SME 7.1 etc.

And if it does not solve the problem for my ibay and php how do you change it back to default, or change back to the previous state ???

Thanks