19

I'm getting this:

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

So I'm following this tutorial.

But I have no idea what to put in "username".

This is how it looks when I launch the terminal:

alex@alex-System-Product-Name:~$

My user is "alex", eg:

/home/alex

Any suggestions?

2 Answers 2

43

The chown command has the following syntax:

chown username:groupname directory

So in your example command it is your primary group name you need to put To determine your current user name issue the command as below on a terminal

whoami

This will return your current user name. Then issue this command to determine your group memberships

groups username

Assuming that your username is "alex", run:

groups alex

You will get something like:

alex : alex staff adm cdrom lpadmin admin

The first one after the : is your primary group. In this example it is "alex".

The command will be:

sudo chown -R root:alex /var/lib/php/session
4
  • Thanks I think it helped but I'm getting this: chown: cannot access /var/lib/php/session': No such file or directory` '
    – janoChen
    Jun 17, 2011 at 5:57
  • Yes, That directory may not be there. The command will work only when the directory present. So you might have missed some steps in that documentation or some steps before that did not work as expected.
    – Jamess
    Jun 17, 2011 at 6:00
  • Usually I do 'ls -l /var/lib/php/session' to list the directory to see current ownership before I change it. Then I will know how to revert it if something gone wrong!. That command will help you to see if the directory present or not as well.
    – Jamess
    Jun 17, 2011 at 6:02
  • 1
    As per your answer, shouldn't the command be sudo chown -R alex:alex directory_path since the username and the first group after the : is alex ? Jul 25, 2019 at 9:29
4

That would be:

sudo chown -R root:alex /var/lib/php/session

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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