SSI...

Started by xiCanadian, March 30, 2012, 10:30:05 PM

Previous topic - Next topic

xiCanadian

Notice: SSI.php was unable to load a session! This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts!

It's included first, and still not working the SSI is on a sub domain thought..

Bigguy

Can you tell us a bit more about the problem. Are there any errors in the error logs. What were you doing when it happened. ???

xiCanadian

Quote from: Bigguy on March 30, 2012, 10:32:20 PM
Can you tell us a bit more about the problem. Are there any errors in the error logs. What were you doing when it happened. ???

I was making a updated version of my new website; and I wanted to include like the SSI Welcome thing but I keep getting this error; its on the index.php


[30-Mar-2012 20:20:14] PHP Notice:  SSI.php was unable to load a session!  This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts! in /home/username/public_html/forum/SSI.php on line 185
[30-Mar-2012 20:27:09] PHP Notice:  SSI.php was unable to load a session!  This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts! in /home/username/public_html/forum/SSI.php on line 185

Bigguy

Did you include SSI at the very top of the file you want it to load in. It must be the first thing loaded before anything else to work.

xiCanadian

Quote from: Bigguy on March 30, 2012, 10:37:01 PM
Did you include SSI at the very top of the file you want it to load in. It must be the first thing loaded before anything else to work.

Yes loook here...


<!-- Forum SSI -->
<?php require("/home/username/public_html/forum/SSI.php"); ?>
<!-- End of Forum SSI -->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Jajaja ~ Home</title>
    <meta name="description" content="">
    <meta name="author" content="">

Bigguy

Can you attach the file please. It looks right but is that all that is in it. ??? The comment at the top might be interferring

xiCanadian

Quote from: Bigguy on March 30, 2012, 10:43:16 PM
Can you attach the file please. It looks right but is that all that is in it. ??? The comment at the top might be interferring

Could I send it via personal message?

Bigguy

Actually ...remove the comments and see if it works. :)

Bigguy

Did that help at all.

xiCanadian


Bigguy

You may have to send it to me to look at. :)

Kays

Hi, SSI.php can pose problems if in a subdomain.

One thing to do is to go into the Admin CP> Server Settings > Cookies and Sessions and verify the following:

Enable local storage of cookies - unchecked
Use subdomain independent cookies - checked
Use database driven sessions - checked

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

xiCanadian

Quote from: Kays on March 31, 2012, 09:07:25 AM
Hi, SSI.php can pose problems if in a subdomain.

One thing to do is to go into the Admin CP> Server Settings > Cookies and Sessions and verify the following:

Enable local storage of cookies - unchecked
Use subdomain independent cookies - checked
Use database driven sessions - checked

Done that, still have the error.

Quote from: Bigguy on March 31, 2012, 08:24:06 AM
You may have to send it to me to look at. :)

Can I send it in a private message?

Roph

Using HTML comments before including SSI is sending output to the browser before you're invoking SSI. It's the same as doing this:

<?php
echo '<!-- Forum SSI -->';
require(
"/home/username/public_html/forum/SSI.php");
echo 
'<!-- End of Forum SSI -->';


The way that you're using HTML comments also doesn't make any sense. HTML comments are sent to the browser, whereas SSI is server side. Anyone viewing the HTML would just see this in your source:

<!-- Forum SSI --><!-- End of Forum SSI -->

It makes more sense to use PHP comments:

<?php
//Forum SSI
require("/home/username/public_html/forum/SSI.php");
?>



But even then it seems pointless, the code is completely self explanatory.

SSI needs to come first; make the very first line of whatever file you're editing have this:

<?php require("/home/username/public_html/forum/SSI.php"); ?>
<!doctype etc blah blah
<head>


And so on.

xiCanadian

<?php
//Forum SSI
require("/home/myusername/public_html/forum/SSI.php");
?>


I did that and I still get that error.

Roph

#15
Is the page you're including SSI on itself included in any other page, with that other page being the page that's called?

Are you sure there is nothing output before you try to include SSI?

There should be no output before including SSI. This also applies for HTML. Even white space counts! Edit your file so that the very first character is the opening bracket (<) from you opening php (<?php) and requiring the SSI.php.

If it still doesn't work, my only other guess is that you have a funky hosting setup. I know some hosts out there (sometimes free hosts) will prepend things to your site's pages, sometimes to serve ads.

Assuming that your forum isn't also on the subdomain, try using your script in some other location, not on a subdomain, see if we can rule that out.

Bigguy

You would have to upload it somewhere and send me the link to it.

xiCanadian

Quote from: Roph on March 31, 2012, 02:49:16 PM
Is the page you're including SSI on itself included in any other page, with that other page being the page that's called?

Are you sure there is nothing output before you try to include SSI?

There should be no output before including SSI. This also applies for HTML. Even white space counts! Edit your file so that the very first character is the opening bracket (<) from you opening php (<?php) and requiring the SSI.php.

If it still doesn't work, my only other guess is that you have a funky hosting setup. I know some hosts out there (sometimes free hosts) will prepend things to your site's pages, sometimes to serve ads.

Assuming that your forum isn't also on the subdomain, try using your script in some other location, not on a subdomain, see if we can rule that out.

It is on a subdomain, and those don't help I still get errors.

Quote from: Bigguy on March 31, 2012, 04:11:55 PM
You would have to upload it somewhere and send me the link to it.

I will upload it on pastebin, and send you it.

Bigguy


xiCanadian


Advertisement: