Jump to content

[SOLVED] Simple question


timmah1

Recommended Posts

When I build my pages, I build a header and a footer, then use a simple include or require to insert them on to other pages

 

I'm moving to a new hosting company, I have this on my header page

<?php
session_start();
require("config.php");
$copy = date("Y"); //grab the current year for the copyright

 

Then, my index page is like so

<?php
session_start);
require("header.php");
?>

 

This worked fine on my other site, but now I get an error saying

Warning: session_start() [function.session-start]: open(/tmp/sess_ef6b506f46073402fe96acfde25bf616, O_RDWR) failed: Permission denied (13) in /home/public_html/index.php on line 2

 

  • Is this because my domain name is not yet Propagated, and I'm using an IP right now, or could it be something else?
  • Is it necessary to declare session_start() on every page, even though it's being defined in the header?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/140609-solved-simple-question/
Share on other sites

Is this because my domain name is not yet Propagated, and I'm using an IP right now, or could it be something else?

 

It appears that you do not yet have permission to write to the /tmp directory where php stores the server side session cookies. I'd speak to your host.

 

Is it necessary to declare session_start() on every page, even though it's being defined in the header?

 

Nope. Header only need to be called within scope of the current request.

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.