|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76344 "Cannot open source device" error should be clearer
Submitted: 2018-05-15 17:16 UTC Modified: 2018-05-15 22:37 UTC
From: andy dot speagle at wichita dot edu Assigned:
Status: Open Package: *General Issues
PHP Version: 7.1.17 OS: RHEL 6.9
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: andy dot speagle at wichita dot edu
New email:
PHP Version: OS:


 [2018-05-15 17:16 UTC] andy dot speagle at wichita dot edu
After upgrading from php 5.6.x to 7.1.17, we're no longer able to start sessions.  Digging through the logs, it seems to be an issue creating session files.  I get this generic error: "Cannot open source device in ..." 

Digging through the stack trace, it tells me clearly that it can't create the session ID file.

I'm using Apache 2.2 on RHEL 6.9 and we're using the "ChrootDir" feature of Apache 2.2 ... I can see with php 5.6.x it was able to use the directory we set in php.ini inside the chroot ... but php 7.1.x doesn't seem to be able to use either the session directory inside or outside of the chroot.  The logs say that it's using /var/lib/php/session that we set... but, it seems to be unable to actually write a file.  Permissions haven't changed since php 5.6.x ... so, they should still be good.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-15 17:19 UTC] spam2 at rhsoft dot net
just fix your chroot so that it contains /dev/urandom and /dev/random

PHP is only the messenger that in your existing setup any from of encryption was worthless because of no proper random sources - chroots needs some thoughts in general
 [2018-05-15 17:28 UTC] andy dot speagle at wichita dot edu
Duh... just like magic.  Thanks for the tip.  That fixed it up for me.
 [2018-05-15 22:37 UTC]
-Summary: Can't create session file at session_start() under Apache 2.2 chroot +Summary: "Cannot open source device" error should be clearer -Package: Session related +Package: *General Issues
 [2018-05-15 22:37 UTC]
"Cannot open source device" is fairly generic. It could use an adjustment to indicate it's talking about reading randomness from wherever. There's also a "Error reading from source device" that should get the same treatment.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 05:01:31 2024 UTC