Even weirder problem.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Even weirder problem.

Post by mikusan »

This one is giving me MAJOR headaches. My problem is with functions. I am making a very modular website where many functions are stored on different *.php files. One of my main files index.php calls another one functions.php which has a set of functions in it. The two are connected with an require_once statement in index.php.

The problem arises when i make a new function in functions.php and then call the function from index.php. My page just dies! blank... as if there is a problem... so i try everything possible... until for some reason... it works!! after some time the function works fine and all good... so ignore the happening and go on with my little life... but now i made a new function, called it... and voila poop in my face... so i desperately try everything...EVERYTHING... and then after like 1 hour it works again.

The old functions there work absolutely fine, the new ones i create are simple output functions that make debugging easy.

Oh my god i really don't understand what is wrong.. and this takes up so much time... Thanks...
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Do you have display_errors turned on in your php.ini? If it's off and there's a parse error, you get no information just a blank page.

Mac
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Well regardless... have you ever encountered a problem of the sort... i mean i change the name of the function many times still no go.. but after a <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> of changes it accepts it and works fine... hooowww?? whhyyy??
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I have encountered this problem with display_errors off in the php.ini (although it was logging the errors to a file). Do you have display_errors on or off in your php.ini. It may not be the problem but is definitely somewhere to start...

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

parse errors will not show up with display_errors=On as long as display_startup_errors is disabled.
Since parse errors take place before any ini_set(,) instruction can be processed you cannot alter the setting within your script but in php.ini or .htaccess
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

I cannot update the php.ini because i am not root, however, although without a plausible error it is hard to find what is wrong... but my code is right... for some reason i cannot make new functions and that bugs me..
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Why don't you post one of the offending functions - maybe we can help a bit better then.

Mac
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Any new function i make somehow gives me the blank page... if i change the call to the function (ie modify the name, position ) a few hundred times... somehowe that one function that i made passes thru... now whatever i do to it somehow php remembers that one "works" and i can work with it... the functions i am talkng of are simple:

Code: Select all

function foo()
&#123;
   echo('hopefully this will display');
&#125;
i call the function from another file...

I am so frustrated...and the problem seems so obscure... i am starting to think it is something within the server settings...
Post Reply