1

I'm trying to create a PHP login system using sessions, which works using a windows localhost server on XAMPP, but when running on fedora's localhost will not save the sessions to /tmp/.

I have found many other users having the same problem and found that the solution was to make /tmp/ writeable, and tried doing this, but still have the problem.

I created an extra script which just creates a file (text.txt) in /tmp/, to make sure that files are able to write to this location, and this file saves with no problem. If I echo the session_save_path, it tells me that it is /tmp/, as is written in php.ini, but they still do not seem to save there.

Steven
  • 11
  • 2
  • 1
    Did you [gave permission](http://stackoverflow.com/questions/9133024/www-data-permissions) to *all* users to write on tmp? Apache/PHP uses the [**www-data** user to write and read](http://unix.stackexchange.com/questions/30879/what-user-should-apache-and-php-be-running-as-what-permissions-should-var-www). When you create your `text.txt`, it's your personal user who created it (or root), not www-data. – al'ein Oct 19 '15 at 13:19
  • i guess it may be selinux preventing to write the files, check if it is enabled by issuing the command `getenforce` and report back – guido Oct 19 '15 at 13:28
  • I'm trying to follow the instructions given in the link about giving permissions to www-data but being told that the group www-data does not exist and getenforce returns Enforcing. – Steven Oct 19 '15 at 13:33
  • yep it is selinux then; on redhat/fedora httpd runs on the apache user not www-data, so that guide is not completely relevant – guido Oct 19 '15 at 13:35

0 Answers0