Errors with my PHP Application

I am building a simple cms for some students and I am encountering some issues

Warning: session_start(): open(/tmp/sess_2bf537e662411562c2220547fdebf3b9, O_RDWR) failed: Permission denied (13) in /home/jboulton/public_html/acme_corp/includes/session.php on line 3


Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/jboulton/public_html/acme_corp/includes/session.php:3) in /home/jboulton/public_html/acme_corp/includes/session.php on line 3



Warning: Unknown: open(/tmp/sess_2bf537e662411562c2220547fdebf3b9, 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 (/tmp) in Unknown on line 0

Here is the code for my session.php page:

<?php

session_start();

function message() {
		if (isset ($_SESSION["message"])) {
			$output =  "<div class=\"message\">";
			$output .=  htmlentities ($_SESSION["message"]);
			$output .= "</div>";
			
			//clear message after use
			$_SESSION["message"] = null;
			
			return $output;
		}
}

function errors() {
		if (isset ($_SESSION["errors"])) {
			$errors = $_SESSION["errors"];
			
			//clear errors after use
			$_SESSION["errors"] = null;
			
			return $errors;
		}
}


?>

I would appreciate any suggestions. Thanks.

Jeff

apache/wwwserver user needs read/write permission to /tmp

Thanks for the quick reply Jim,

The folder is 777:

drwxrwxrwt. 5 root root 4096 Jan 15 11:16 tmp/

Hm, perhaps its full (would lead to you not being able to write to it)

Try this:
Create a dir in your project dir (with write permissions)
Add this to the top of your script(s)

[php]ini_set(‘session.save_path’, ‘tmp’); // where tmp is your custom temp dir[/php]

That solved it. Thanks.

Sponsor our Newsletter | Privacy Policy | Terms of Service