Bizarre problem, PHP doesnt like my framework

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
jcapinc
Forum Newbie
Posts: 3
Joined: Wed Oct 29, 2008 2:38 am

Bizarre problem, PHP doesnt like my framework

Post by jcapinc »

Bizarre Problem
Alright, I develop my own cool framework based off of some tutorials and I am very excited about it 8) . Ive got everything where I want it and everything seams to be working correctly. :D

So I start re-doing my website using my framework, I mean what better way to test it than to use my own website as a guinea pig? :)

The display side of the framework works by using a page object with a "content" method to grab a template page with comment blocks that are used to put content where it needs to go using Regex. The regex recognizes the comment blocks and replaces them with html content that is located in separated files. 8)

One such file which is longer than the rest seems to break my code in a odd way :( . It is not rediculously long, but for testing purposes I gradually reduced its size until it worked, and it came down to one paragraph. When I finally got to the final paragraph I measured the filesize with and without the last paragraph.

Without last Paragraph: 3.0 KB
with last paragraph : 3.5 KB

So its not like I'm processing MB of info and its overloading!

Before I continue why dont I actually tell you what the error message was!

It was nothing :dubious:

I got a veritable white screen of death in PHP :dubious: :dubious:

Thats why I turned to a forum on this one. I really, really cant figure out why this does not want to work. The reason I cant figure it out is because PHP is giving me nothing to go on! I love PHP for its descriptive error messages, and I even use XDebug to enhance them, which is great, but this time PHP has left me out in the cold!

To make things more bizarre, it is not even giving me the ability to print things BEFORE the code runs! I tried to write something in before the <?php ?> that runs my framework, and it gave me nothing! That means PHP did not just have an error... it crashed and gave me truly no output at all :?: :dubious: :?:

and I ran memory tests for peak memory usage without the final paragraph and they are no where close to causeing an issue, not even totaling a third of a megabyte

help me! Why would this crash if its not even approaching memory issues! :banghead: :banghead: :banghead: :evil:
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Bizarre problem, PHP doesnt like my framework

Post by requinix »

I assume you have display_errors on?

Start putting in statements like

Code: Select all

die("" . time())
and reloading the page. If you see a number then put the statement somewhere else. If you don't, move the statement earlier until you do.
Then you'll figure out where it's crashing.
If you at least find a general area or file then post the code and we can take a look at it.
jcapinc
Forum Newbie
Posts: 3
Joined: Wed Oct 29, 2008 2:38 am

Re: Bizarre problem, PHP doesnt like my framework

Post by jcapinc »

tasairis wrote:I assume you have display_errors on?

Start putting in statements like

Code: Select all

die("" . time())
and reloading the page. If you see a number then put the statement somewhere else. If you don't, move the statement earlier until you do.
Then you'll figure out where it's crashing.
If you at least find a general area or file then post the code and we can take a look at it.
The simplest advice is often the best advice I should have thought of that.

My program is too complex to simply post, ive got two classes and one calling script, but using this simple and ingenious method I tracked down the exact culprit of the problem.

It is a preg_match function :

Code: Select all

 
$pattern = $this->create_block_pattern($name);
$bool = preg_match($pattern,$this->content);
die("test");
return $bool;
 
I have it measured down to the character now, when the content file is beyond a certain size, it does not even try to process it it just dies without any output

that die("test") does not give me an output, the preg_match is somehow beating me to it, only its not giving me any helful error messages at all.

and yes, I have the highest level of error messaging set because I am in severe debug mode ;)

Thank you for the quick response, this help is most appreciated
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Bizarre problem, PHP doesnt like my framework

Post by requinix »

What's (the value of) $pattern?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Bizarre problem, PHP doesnt like my framework

Post by Eran »

You should probably check your server error logs to find out what killed the process.
jcapinc
Forum Newbie
Posts: 3
Joined: Wed Oct 29, 2008 2:38 am

Re: Bizarre problem, PHP doesnt like my framework

Post by jcapinc »

pytrin wrote:You should probably check your server error logs to find out what killed the process.
Another exellent suggestion!! I have identified the error message and here it is :

Code: Select all

[Wed Oct 29 16:29:36 2008] [notice] child pid 18880 exit signal Segmentation fault (11)
Im going to google it and see what I can find, but if this sticks out to anyone that knows better than me, please say something.

Thanks for being such a helpful crowd! :)
Post Reply