guests only see balnk screen, the function ‘template_header()’ is causing errors

Started by oistarbwoy, September 20, 2009, 09:08:43 AM

Previous topic - Next topic

oistarbwoy

right so i'm building a rather complicated site that has a lot of mods on it.

as of earlier today i noticed that if you are not logged in you get a blank white page of doom on index.php and index.php all other functions work fine. this is obviously a massive problem. when i am logged in it is all fine.

the only new mod installed before i got this problem was the custom forms mod. it has permissions to whether or not guests can see its form page. i tried switching this on and off. and guest acsess off produces the same effect for the form action as the blank page of doom! however guest acsess being switched on doesnt make the forum action work again.

i found no help in the mods thread as the mod installed fine with no errors so i have no idea how it has effected guests viewing the forum... does anyone have any ideas of how i can fix this problem?

urgent help would be much appreciated. thanks in advance :)

UPDATE: i am told that this is the problem 'the function 'template_header()' is causing errors in Subs.php script' does anybody know how to fix this?

Arantor


oistarbwoy

looking through them now i have an undefined index error thats filled the thing up so it might take a min or 2 brb

UPDATE: no i have no error logs relating to this problem at all.

thats not very helpfull is it?

Arantor

What are the errors you do have? They may be unrelated, they may not.

oistarbwoy

ok the reason why i dont think its related to the multi forums is the problem is on the main forum whose files havnt been modified to point to different database, its that forums database.

the other forum has had no changes or anything posted on it whatsoever plus they've been set up like that for months and i only had this problem since i installed the custom form mod which i have uninstalled now.

the error log says

8: Undefined index: cancel

and

8: Undefined index: off-topic

in my subs.php file



i get those same error when logged in as a regular member, a guest or admin... thats why i thought it wasnt related to the error.

Arantor

So:
Under what circumstances exactly do you get a white screen as a guest? All pages, some pages?

Does it ever occur elsewhere, i.e. as a registered user?

Out of interest, are you sharing the sessions table?

oistarbwoy

yes the sessions table on the other forum is set to the one from this.

i only get the white screen when i go to index.php or index.php?action=forum
all other actions are fine. even mods like action=articles

if you go here you can see the site, and it lets you log on
http://www.emotionall.org/EmotionALL/c/
if you go here then you'll see what i mean about the blank page
http://www.emotionall.org/EmotionALL/c/index.php


i made a member acount username:check password: check

so you can see what i mean about the lack of a problem for members maybe you'll see something im missing. but i'm sure you'll see why i think theres a problem with permissions.

if you could take a look at it and see the problem for yourself i would be very grateful. thanks for your time btw

Arantor

I don't see it as directly permissions related, it's more guest related.

So, with the first page, what file is it loading exactly? Also, please attach c/index.php here.

oistarbwoy

The first page... thats the part that has me stumped because as far as i knew it was loading the index.php file. but im not sure. it brings up articles from simple portal so i guess its from there. i just know its the place i get redirected to when i type an action that doesnt exist.

ive just realised that i cant see the 'home' page either as a guest which is the simple portal front page.

i have attached my index.php like asked.

Arantor

I'm slightly concerned that it's failing in this way.

I'm more concerned that there's nothing in the server error log about this, because it's an error "somewhere" in the system. Please ask your host to enable the server error log so we can see where the errors are.

oistarbwoy

im waiting for a response from my host.

i dont know if this is helpfull at all but the guy who made the custom form mod said this...

Quote from: Garou on September 20, 2009, 11:13:18 AM

Quotealso quite catastrophically since installing your mod i made the annoying discovery that guests can no longer see anything other then a blank page when they go to index.php or action=forum. all other actions they can see just fine. i tried enabling guest acsess to the form page for guests... but they still cant see my main forum index... they can see the form page though.

This mod does not alter any of the existing global permissions, it just adds its own to the list. The only permission problem this mod has is that if you do edit the permissions for a group in index.php?action=admin;area=permissions that it will remove all the Custom Form permissions.

In looking at that problem, its caused by the fact that the mod tries to store it's permissions in the permission database but there isn't a function to display them on the permissions page. Therefore when the group permissions are changed it blanks out the ones for the forms. Now that I know whats causing it Ill either have to edit the permissions page to show the CF permissions or move them to the cf_forms database. None the less this isn't the cause of your problem.

If uninstalling the mod didn't fix the problem, I'm sure that the mod isn't what caused it either. My guess is you need to check your index.php?action=admin;area=permissions or perhaps there is a problem with your theme.

Also of note: if the permission to show the form list for a group isn't set in the Custom Form Mod Settings then it should bounce the user back to the Forum Index page. Also if there are no forms set with the permission for that group then the Form List will not show and forms as they cant use them.




i dont know how if not the mod any change could have been made to my forum as i didnt edit anything else other then installing that mod. and it never did bounce back like he said either it just showed a blank page if you were a guest. it was this blank page that prompted me to go to my home page and discover that was blank also.

it deffinately all worked fine before installation as i looked around as a member, guest and admin just prior to the fail because tonight i was planning on setting all permissions for boards and blocks, its on my to do list.

Arantor


oistarbwoy



Arantor

Quite simply it's running out of memory. Try getting the host to increase the mem_limit to 24M from 16M.

oistarbwoy

i took your advice i got them to up the memory.

but now i still cant see those pages as a guest but it brings up this error

The server encountered an unexpected condition which prevented it from fulfilling the request.
The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log

Arantor


oistarbwoy

i guess they just said they'd increased the memory... in oppose to actually doing it

PHP Fatal error:  Allowed memory size of 16777216 bytes exhausted (tried to allocate 40961 bytes) in /Sources/Subs.php on line 2821

:'(

Arantor


oistarbwoy

is there any other way i can fix this? cos i just got an email saying my request has been processed and my host will make the changes in 7-10 working days.

which is.....

i dont have words for what that is in fact

Arantor

Not really. It's failing due to out of memory. Without going back through every piece of code to work out where the memory hit is, it isn't possible to do.

oistarbwoy

good news and bad news.

the good news is i now have acsess to my own php.ini file

the bad news is i uped the memory to 32 and still i cant get it to work for guests. i used a phpinfo file to check the change was actually made and its 32M so i dont get why i still cant make it work?

I'm not sure where to go from here, the error says its out of memory i up the memory still the same thing... what next?  ::)

Arantor

Did you restart the webserver when changing it? It won't change unless Apache is reloaded.


Arantor

You need to ask the host to do so unless you're the server admin. No changes to httpd.conf take effect until either Apache is restarted or the configuration is reloaded.


Arantor


oistarbwoy

globat.... their not helpful at all they wont do it and so my site is still not working and i have no idea what to do!

Arantor


oistarbwoy

yeah tell me about it... i found out today that they way to get some attention from my host is to pay for 'premium suppor't just 15mins after i payed for it i got this message... (as if they couldnt have told me this last night!)

"We have increased memory limit to 53M. But still script gives errors. We have checked the script and noticed that the function 'template_header()' is causing errors in Subs.php script. We suggest you to contact webmaster or application vendor to correct the code. "

can it be fixed?

Arantor

It would be helpful if they bothered to say what the errors are - to say there are errors in Subs.php is probably more useless than not since it's at least 4,000 lines of code.

Garou

In looking at the site, I'm wondering if it has something to do with your Simple Portal settings. For instance you can go directly to the portal page or a thread 'index.php?topic=#' but not 'index.php?action=forum' or 'index.php'

oistarbwoy

Quote from: Garou on September 21, 2009, 08:36:23 PM
In looking at the site, I'm wondering if it has something to do with your Simple Portal settings. For instance you can go directly to the portal page or a thread 'index.php?topic=#' but not 'index.php?action=forum' or 'index.php'

right how bizare... i thought simple portal, well thats worth a try so i put it into a couple of different modes to see if that amde a difference.

it didnt

so then i wondered if perhaps there was a very basic guests allowed to view simple portal permission somewhere that hadnt been ticked or something.

so i went into permissions and noticed that  guests had very few i added a few more for some mods that i'd never sorted permissions for like, view profile comments etc.

then i came back to the site and suddenly everything is working again

:D

obviously im really happy but i still cant figure out exactly what fixed the problem or what caused it so im slightly nervous it may happen again.

so im going to investigate a little further before i mark this as solved. thanks guys by the way for your time and help.

oistarbwoy

i have identified the problem.

drum roll please...

when guests are not allowed to view articles (as in the smf articles mod) then that is the result. The temporary fix is to enable guests to view articles.

although when i change custom forms permission settings it unchecks the allow guests to view articles one.

is this some kind of conflict between the mods, dya think? also worth noticing it doesnt affect article permissions for any other member group, just guests.

either way the fix is to set custom forms first and then go over all the guest permissions in the general permissions bit.

and i am a very happy bunny now all is well on my site  :)

Arantor

Interesting - that said it still shouldn't cause a flat out error, and it may be worth reporting that on the SP site (www.simpleportal.net)

Advertisement: