php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
35 - 35 = ?
Subscribe to this entry?

 
 [2018-05-15 17:16 UTC] andy dot speagle at wichita dot edu
Description:
------------
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.






Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] requinix@php.net
-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] requinix@php.net
"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: Fri Apr 19 02:01:29 2024 UTC