Why I get 500 Status code instead of nice warnings & erros?

Hello , i don’t know if this could be fixed, but everytime i have an error in a php script i get an 500 status from Apache instead of simple “error debug” from php.

I put here an error page :
http://softgroups.com/root.php
you can find it in /home/bogdan/www/root.php

the code is :

<?php
for(
echo “Hi!”;

?>

but, for any error will work like this

Odd, I get


Parse error: syntax error, unexpected T_ECHO, expecting ';' in /home/bogdan/www/root.php on line 3

Did you happen to fix it?

What you’re describing is a function of the error settings in PHP. If this is your server, you can change it in php.ini but, if on a shared server, you’ll need to add the appropriate PHP code for your page (I don’t recall it off-hand; I rely on php.net’s excellent documentation).

As for your 500 errors, that’s normally a function of an error code (generally Apache but your situation is PHP).

for ({NOTHING?} echo “something”; is clearly NOT valid PHP code. for is used to start an iterative loop but you’ve got no iteration value, test or step increment nor do you have a closing parenthesis. If this is supposed to be a conditional test, use if (boolean test) {do something};

Kevin Yank’s book would be a great place for you to start.

Regards,

DK