Warning: session_start(): open() failed: Permission denied

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Warning: session_start(): open() failed: Permission denied

Post by Luke »

I was editing an application... didn't even really do anything to it, and I'm pretty sure I undid all the changes I made, but for some reason this is all I get now... wTF??
error wrote: Warning: session_start(): open(/sess_68056dae694c4429d94d1b66bb952b80, O_RDWR) failed: Permission denied (13) in /vservers/silversteep/htdocs/mc2fm/incl/classes.inc.php on line 366

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /vservers/silversteep/htdocs/mc2fm/incl/classes.inc.php:366) in /vservers/silversteep/htdocs/mc2fm/incl/classes.inc.php on line 366

Warning: Cannot modify header information - headers already sent by (output started at /vservers/silversteep/htdocs/mc2fm/incl/classes.inc.php:366) in /vservers/silversteep/htdocs/mc2fm/admin.php on line 267
MC2 FileManager v2.0
Warning: Unknown(): open(/sess_68056dae694c4429d94d1b66bb952b80, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

What operating system is that on? Looks like it's not able to write sessions. Could be an SELinux problem if it's Fedora or Redhat and you made any path changes.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

it's linux... I was messing with the base_url attached to links (PHPSESSID=blabla) but it's back the way it was and it won't work anymore.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Try restarting apache if you changed everything back.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I can't restart apache... it's on a hosted server... I guess I can put in a support ticket, but what the hell happened? This makes no sense!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

What exactly did you change, was it in php.ini or in a php file? Can you post the bit you changed?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

All I changed was a line in my functions script:

I changed this from

Code: Select all

function get_linked_path($path,$base_url)	## Get path with links to each folder
{
 $string = "<a href='$base_url'>Data Site</a> / ";
 $array = explode("/",htmlentities($path));
 unset($array[count($array)-1]);
 foreach ($array as $entry)
 {
  @$temppath .= $entry."/";
  $string .= "<a href='$base_url&path=".htmlentities(rawurlencode($temppath))."'>$entry</a> / ";
 }

 return $string;
}
to this:

Code: Select all

function get_linked_path($path, $base_url, $user_dir="/")	## Get path with links to each folder
{
 $string = "<a href='$base_url'>" . $user_dir . "</a> /";
 $array = explode("/",htmlentities($path));
 unset($array[count($array)-1]);
 foreach ($array as $entry)
 {
  @$temppath .= $entry."/";
  $string .= "<a href='$base_url&path=".htmlentities(rawurlencode($temppath))."'>$entry</a> / ";
 }

 return $string;
}
I looked at the page and BLAMO! Error central... so I changed it back and it's still broken!!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

That makes no sense. Maybe your host was messing with something at the same time. The only other thing I could think of is that you changed the permissions of the functions file, but I don't see how that would cause the error your getting either.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

It's completely wild! I am so confused. I send a support ticket to my host... I hope its their fault because I have ABSOLUTELY no idea what's causing this.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

well, the problem is obvious:
Warning: session_start(): open(/sess_68056dae694c4429d94d1b66bb952b80, O_RDWR) failed
PHP tries to save session data to the root folder (which isn't writeable on any sane Unix system).

You may try to use session_save_path() to point session storage engine to the correct directory (usually '/tmp/')
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

The weird thing is that it WORKED before. What could have made it change?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

I'm not sure that is something you changed. Unless your setting the session_save_path before session_start() is called, someone modified php.ini. If you didn't change it, your host did. Just a coincidence I believe.
Post Reply