News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Problems getting SSI to work

Started by More-to-life, July 27, 2010, 05:12:55 PM

Previous topic - Next topic

More-to-life

I'm having problems using SSI
I've tried all the methods posted on the forum but all I get is a blank white screen
I'm trying to add a custom page outside of my forum so I need the header & footer files but I can't seem to even get SSI to work
I've also tried the examples listed here
http://www.simplemachines.org/community/index.php?topic=243833.40

Any ideas?

Thanks in advance
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

cicka

Quote from: welshbikers on July 27, 2010, 05:12:55 PM
I'm having problems using SSI
I've tried all the methods posted on the forum but all I get is a blank white screen
I'm trying to add a custom page outside of my forum so I need the header & footer files but I can't seem to even get SSI to work
I've also tried the examples listed here
http://www.simplemachines.org/community/index.php?topic=243833.40

Any ideas?

Thanks in advance

Can you try the tut I posted here?

http://www.simplemachines.org/community/index.php?topic=390247.msg2698239#msg2698239

More-to-life

Thanks for your reply but all I get now is 500 internal server errors I've tried different paths to the SSI file
../forum/SSI & even the ful URL but still the same

Im starting to think the SSI file has errors could someone check the file for me?
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

chilly

you cant use url to include something.

url is a webadress not path to your file.
where is the site your running located and in relation to that site where is the forum?
and whats the code you use to include ssi.php?

Language Coordinator

More-to-life

I tried this code

<?php 
//Set the banning active
$ssi_ban true;

//Path to SSI.php
require(dirname(__FILE__) . '/SSI.php');

//Page title. This will appear in the browser
$context['page_title_html_safe'] = 'Custom Page';

//This is self explanatory
template_header(); 

//Here we define the link tree
$context['linktree'] = array(
'href' => $scripturl,
);

//Here is the content, such as the title and the body message of the custom page.

echo'
<span class="clear upperframe"><span></span></span>
<div class="roundframe"><div class="innerframe">'
;
echo
'
<div class="cat_bar">
<h3 class="catbg">Hello everyone</h3>
</div>
<p>This is a custom page example. pretty cool, huh.</p>'
;
echo
'
</div></div>
<span class="lowerframe"><span></span></span>'


//This is self explanatory too. 
template_footer(); 

?>



My SSI file is located http://www.mysite.co.uk/forum/SSI.php  the page I want to create will be at the root so www.mysite.co.uk

Thanks in advance
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

chilly

so your calling a scriptto do the work
and telling that it has to look in the same folde to look for "SSI.php" while YOU know that SSI.php is not in that older?

require(dirname(__FILE__) . '/SSI.php');
i'd suggest replacing require() with require_once()

__FILE__
gives you the absolute path + filename to the file called via url. lets say: index.php
dirname(__FILE__)
extracts only the path and no filename.

so to include your SSI.php i'd say you have to go from current path to subfolder "forum" to include your SSI.php

i'm not giving you the corrected line because i'm hoping you find out yourself. that would help you learn to deal with this stuff.

Language Coordinator

More-to-life

OK thanks for your help but I know very little about this so Im lost I copied the code from Clika who kindly pointed me in the direction of her post regarding the subject

I then followed the instructions about SSI paths & using ../ if the page is outside your forum & all I get is a 500 error

Ive tried ../forum/SSI.php & even tried /SSI.php & SSI.php then trying the custom page inside the forum but still a 500 error
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

chilly

Quote from: welshbikers on July 28, 2010, 09:49:26 AM
OK thanks for your help but I know very little about this so Im lost I copied the code from Clika who kindly pointed me in the direction of her post regarding the subject

I then followed the instructions about SSI paths & using ../ if the page is outside your forum & all I get is a 500 error

Ive tried ../forum/SSI.php & even tried /SSI.php & SSI.php then trying the custom page inside the forum but still a 500 error

../forum/SSI.php - first your going a folder upwards in folder hierarchy than you want to move to the folder called "forum". that folder doesnt exist here
/SSI.php - file is not in this folder
SSI.php - I dont know how your root folder is named but i'm sure there is no file named like your rootfolder + SSI.php
require(dirname(__FILE__) . '/forum/SSI.php'); - use this

please learn the basics first.
you cant cant go skiing without knowing how to get to the mountain

Language Coordinator

More-to-life

I appreciate your help & I enjoy learning about SMF but ive already tried that path & still nothing I get a 500 error or a page can not be displayed

Everybody has to start somewhere & Im trying my best to learn but everyone needs a little help along the way don't they :)

Do you think my SSI file could be corrupt?

If so could I replace it with a fresh copy?
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

chilly

as I can access your normal site and SSI.php the only thing I can imagine is wrong rights for the files.
you can try
if(file_exists(dirname(__FILE__) . '/forum/SSI.php'))
{
echo "SSI.php found";
}

just to check if your script can see SSI.php

Language Coordinator

cicka

Can you try to use this for the path?

require("/path/to/SSI.php");

And enter the full path.

More-to-life

OK I tried that & got this response

SSI.php found

So I guess this is good news & it's not permissions or a corrupt file then
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

cicka

Quote from: welshbikers on July 28, 2010, 10:39:33 AM
OK I tried that & got this response

SSI.php found

So I guess this is good news & it's not permissions or a corrupt file then

Did you get it solved now?

chilly

Quote from: welshbikers on July 28, 2010, 10:39:33 AM
OK I tried that & got this response

SSI.php found

So I guess this is good news & it's not permissions or a corrupt file then
that only means php can find the file. it needs the permission to read it (i'm sure if thats enough Oo. never hat problems with file permissions yet)

Language Coordinator

More-to-life

Quote from: cicka on July 28, 2010, 10:38:55 AM
Can you try to use this for the path?

require("/path/to/SSI.php");

And enter the full path.

Hi Clika

I tried the code above & Im back to no errors but just a blank white page :o

Quote from: chilly on July 28, 2010, 10:30:35 AM
as I can access your normal site and SSI.php the only thing I can imagine is wrong rights for the files.
you can try
if(file_exists(dirname(__FILE__) . '/forum/SSI.php'))
{
echo "SSI.php found";
}

just to check if your script can see SSI.php

With the code above all I got was SSI.php found on a white screen & nothing else
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

More-to-life

If you think it's file permissions what files should I change & what permissions should I give them?

Thanks in advance
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

cicka

Quote from: welshbikers on July 28, 2010, 10:48:51 AM
If you think it's file permissions what files should I change & what permissions should I give them?

Thanks in advance

Try to chmodd it to 755 or 777. Can you please post the url to your custom page and the custom page 's codes that you are using?

chilly

I'd say the file permissions of SSI.php need to be changed but cant say what really is correct.

temporary to test you can set 777 as file-permission. than run the script you had before (with the adjustment i suggested with the path. as you last test said "SSI.php found" the path used there is correct!)

Language Coordinator

More-to-life

Good news I changed the SSI file permissions to 755 & it worked like a charm ;D

Are the file permissions set to low as default?

Thanks all for your help I'll mark as solved
UK Bike Forum - The biggest motorcycle forum magazine in Wales UK.
Gear Up Magazine - Gear Up Motorcycle Magazine.
United Bikers UK Motorcycle Forum - A Brand New UK Bike Forum.
Used Cars South Wales - Search For Your Next Used Car In Laleston, Bridgend, South Wales.
Bikers Of Wales Motorcycle Website - Motorbike Info
Honda - Honda UK

cicka

Happy to see that you got it worked out :)

Advertisement: