Solved;partially: PHP 5.2 -> 5.3 Windows Apache2.2 crash

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
jett
Forum Newbie
Posts: 2
Joined: Wed Mar 03, 2010 7:07 pm

Solved;partially: PHP 5.2 -> 5.3 Windows Apache2.2 crash

Post by jett »

Found this would only happen when encoded with Ioncube (though using their latest loaders).. to bug them about it.



Hi,

Recently moved from 5.2 to 5.3.

Now Apache will crash on loading pretty much all my pages with this in the error report;

szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll
szModVer : 5.3.1.0 offset : 0000c266

Eventually found out how it happens.

If I pass to a function an undefined variable as per example;

function testing($var1,$var2){
return 1;
}

echo testing($undefined1,$undefined2);

It will crash. No error in Apache log, no error in PHP log.

If I define $undefined2 before calling testing() then it won't crash.

Whether I define $undefined1 or not (strangely, if not strange enough already) doesn't make any difference, only causes a crash on the second or higher variable in the function definition.

Whether or not I specify $var2 = null or any other value in the function definition; it will still crash if $undefined2 is not previously defined.

Looking at the changes between 5.2 and 5.3 ; I assume this problem has spawned from this reported change

"The newer internal parameter parsing API has been applied across all the extensions bundled with PHP 5.3.x. This parameter parsing API causes functions to return NULL when passed incompatible parameters. There are some exceptions to this rule, such as the get_class() function, which will continue to return FALSE on error"



Now; I'm sure you may say, well that's just bad coding practice, you should always define your variables before calling them. Perhaps that may be true; but from the many years that I have constructed my system , I have depended on this behaviour and it suits me well. If I am to change the way I code; then it will take a little while for me to fix this issue.


So I guess I am just asking at this stage if anyone can confirm the issue at hand; then I suppose I will submit a PHP bug report and hope something can be done.

Appreciate any help,


Jett
Last edited by jett on Wed Mar 03, 2010 11:54 pm, edited 2 times in total.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP 5.2 -> 5.3 Windows Apache2.2 strange crash

Post by requinix »

Are you sure you upgraded everything properly? Remembered to replace the old php5ts.dll with the new one?
jett
Forum Newbie
Posts: 2
Joined: Wed Mar 03, 2010 7:07 pm

Re: PHP 5.2 -> 5.3 Windows Apache2.2 strange crash

Post by jett »

Yep, whole folder is straight from PHP 5.3.1 Zip from PHP's download servers.

Related to this; I'm testing on my local test machine (windows), the production server is on Linux; and it controllled by our server guy who has no issues except with my system/pages (!). So now they have downgraded back to 5.2 until I can fix the issue.
Post Reply