session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)


I’m running DreamFactory on Debian and regularly face this error. Not only is it annoying, it also terminates active sessions.
This is something that should not happen unless the PHP-application overrides the “session.gc_probability = 0” setting from the php.ini.

What exactly does DF do here?

On what version of PHP are you running DSP 1.9.1 when you get this error?

This is a common issue on Debian and its derivatives, because Debian uses a cron job for session cleanup rather than leaving it to Apache/PHP like other environments typically do. Typically this error is seen because the default permissions of the sessions directory aren’t configured for this, and eventually there is a garbage collection conflict.

A quick Google search provides two possible ways of resolving this. (There may be more.)

  1. Change permissions on the directory in question.
  2. Edit garbage collection probability setting in php.ini.