absolut

Member
Jul 29, 2003
13
0
151
Porto - Portugal
Hello,

I'm having some problems configuring my server sessions in php.

Server espec:

WHM 11.2.0 cPanel 11.11.0-S18033
CENTOS Enterprise 4.5 i686 on standard - WHM X v3.1.0
PHP version 5.2.4
MySQL version 4.1.22-standard
Apache version 1.3.39 (Unix)

Sessions def. in php.ini:
Code:
[Session]
session.save_handler = "files"
session.save_path = "/tmp/sessions"
                                    ; in the case of files, this is the
                                    ; path where data files are stored
session.use_cookies = 1
session.name = "PHPSESSID"
                                    ; name of the session
                                    ; is used as cookie name
session.auto_start = 0
session.cookie_lifetime = 0
                                    ; or if 0, until browser is restarted
session.cookie_path = "/       "
session.cookie_domain =
session.serialize_handler = "php     "
                                    ; php is the standard serializer of PHP
session.gc_probability = 1
                                    ; 'garbage collection' process is started
                                    ; on every session initialization
session.gc_maxlifetime = 1440
                                    ; data will be seen as 'garbage' and
                                    ; cleaned up by the gc process
session.referer_check =
                                    ; externally stored URLs containing ids
session.entropy_length = 0
session.entropy_file =
; session.entropy_length    = 16
; session.entropy_file      = /dev/urandom
session.cache_limiter = "nocache "
                                    ; determine HTTP caching aspects
session.cache_expire = 180
session.use_trans_sid = 1
                                    ; by compiling with --enable-trans-sid
Register globals are ON

First I recieved about 7 e-mails from clients saying that in joomla pre instllation teste sessions.save_path was unwritable.
I went to /temp created a sessions folder and chmoded it to 777

After that they still can't login on the admin area
Error: Warning: session_start() [function.session-start]: Cannot find save handler files in /home/asasdosa/public_html/site00/administrator/index.php on line 111

From what I could read on-line in joomla this means that clients can't save sessions file in the session.save_path although it is writable. But never saw a solution for it, because it was all client oriented. All the solutions were contact your isp.

Well they did contact, but the isp doesn't know how to fix it :)

Could you please help?

Thank you,
absolut
 

swapneel

Member
Oct 2, 2006
8
0
151
You have the session.save.path set as,

session.save_path = "/tmp/sessions"

which means all the PHP session files would go into /tmp/sessions directory.

Ideally one has session.save.path is set as /tmp which is writable to all and has the sticky bit set.

You can either set this to /tmp only in php.ini or make sure that /tmp/sessions is writable to all and has the sticky bit set so that only the user which owns the file will be able to delete it.
 

joaoarosoa

Registered
Dec 1, 2007
3
0
51
I chmoded it to 777 so I supose it's writable to all. Problem is most scripts take /tmp/sessions as default so I really need to use that folder. But I have chmoded it to 777 so aparently it would work.

Any idea?

thanks,
João
 

joaoarosoa

Registered
Dec 1, 2007
3
0
51
For anyone who will eventually face the same problem that's what I did:

In my server I have php 4 running as secundary, and then i added this line:

AddHandler application/x-httpd-php4 .php .php5 .php4 .php3 .phtml
to .htaccess

In php4 it runs with no problem. From what I can see itis a problem from joomla with php5.

Correct me if I'm wrong, anyway with me it worked.

Thaks,
João