i have a problem with apache. session_start() error. i think my apache have not permission to write and i don't know how fix it. i run:

ls -al /var/lib/ | grep php5
drwx-wx-wt  2 root          root          4096 Apr  4 16:15 php5

what can i do? thanks for help

link|improve this question
feedback

1 Answer

up vote 0 down vote accepted

First of all, are you sure it stores the sessions in /var/lib/php5? Do you have root access? If so, you can fix it yourself, if not, ask your admin to do the same as you would to fix it yourself, namely this:

  1. find out who apache runs as (for instance, `www-data`, `apache`, or `httpd`)
  2. make the session directory writable for that user.

For instance: ps -ef | egrep -e 'http|apache' will show on the first column the username of the apache user. On my machine the username is apache.

Check the group membership of that user with id -a apache

uid=48(apache) gid=48(apache) groups=48(apache)
               ^^^^^^^^^^^^^^

Then change the group ownership and permissions on the sessions directory:

chgrp apache /var/lib/php5/session && chmod g+w /var/lib/php5/session

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.