Jump to content

Warning: session_start()


Notoriouswow

Recommended Posts

I have a PHP script for my website, it requires information from my database but i keep getting this error whenever I try to use it.

 

Warning: session_start() [function.session-start]: open(..\Server\tmp\sess_a2ad2e8373eb70d668f1af9e465c7e14, O_RDWR) failed: No such file or directory (2) in C:\Server\Website\htdocs\avs\index.php on line 25

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:Server\Website\htdocs\avs\index.php:25) in C:\Server\Website\htdocs\avs\index.php on line 25

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Server\Website\htdocs\avs\index.php:25) in C:\Server\Website\htdocs\avs\index.php on line 25

 

I've Tried Modifying The Script But No Luck, Heres The Script Im Working With.... Please Help

<?php


define("LOGON_HOST","localhost");
define("LOGON_USER","root");
define("LOGON_PASS","ascent");
define("LOGON_DB","logon");
define("ENCRYPT_PASSWORDS",false);

define("MYSQL_HOST","localhost");
define("MYSQL_USER","root");
define("MYSQL_PASS","ascent");
define("MYSQL_DB","avs_voting");

define("MAIL_SUBJECT","Thanks For Voting!");
define("MAIL_BODY","Thank you for voting for our server. Here is your reward!");

define("RPPV",3);

session_start();

if(!$_SESSION['vcp']['authenticated'] && $_GET['act'] != "vote") /Line 25
{
        include("pages/login.php");
        new Login();
        die;
}
switch($_GET['act'])
{
default:
        include("pages/overview.php");
        new Overview();
        break;
case "rewards":
        include("pages/rewards.php");
        new Rewards();
        break;
case "spend":
        include("pages/spend.php");
        new Spend();
        break;
case "vote":
        include("pages/vote.php");
        new Vote();
        break;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/187196-warning-session_start/
Share on other sites

It would appear your server process's user does not have permissions to write to the session.save_path data directory. Have you made any modifications to this setting via php.ini or other directive?

 

No i haven't modified that file what so ever.

 

What bothers me is that it worked on my former site but it doesn't work for this one.

 

Would you like the scripts in the directories.... /pages/login.php ect.?

Does the directory C:\Server\Website\htdocs\Server\tmp\

 

Exist? That's a kind of strange session save path.

 

Perhaps you meant to set it to \Server\tmp instead of ..\Server\Tmp?

 

Yes it does exist, i changed the names to make it simpler on myself, everything else works fine so it cant be the directory.

everything else works fine so it cant be the directory.

 

Read the error message. It clearly states 'No such file or directory'

 

Try using an absolute path to the directory.

 

I made everything an absolute path as you suggested, and it didn't do much[ just made the error page load faster.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.