View Full Version : Since suPHP, php error's into a HTTP-500
BlueCola
01-22-2012, 07:55 AM
I updated last week to suPHP. I was just making a website, when I noticed that when I make a error in php, I didnt get 'Expected T_ELSE', but instead i did get a HTTP 500 error. I really don't like this, because you need to check the /var/log/httpd/domain/domain.error.log to see what's wrong. Also, customers don't have access to that folder ofcourse, so they can't see their error's. What can I do to fix this? Is there a possibility to write logs to the home/user map instead, or just show the PHP error on the page instead of 500?
SeLLeRoNe
01-23-2012, 12:17 AM
Probably is something now blocked in .htaccess.
Check if your user have an .htaccess file and post here.
Probably is FollowSymLink directive
Regards
BlueCola
01-23-2012, 12:00 PM
No, that isn't the problem. My script is:
<?php
echo "Please give me an error!<br />"
echo "Can you do that for me?;
?>
With this script, I trigger an internal 500 error. If I edit it to:
<?php
echo "Please give me an error!<br />";
echo "Can you do that for me?;
?>
it runs fine.
BlueCola
01-23-2012, 12:01 PM
EDIT: Sorry, needed to edit the post, this is how i ran the script:
No, that isn't the problem. My script is:
<?php
echo "Please give me an error!<br />"
echo "Can you do that for me?";
?>
With this script, I trigger an internal 500 error. If I edit it to:
<?php
echo "Please give me an error!<br />";
echo "Can you do that for me?";
?>
it runs fine.
SeLLeRoNe
01-23-2012, 12:03 PM
mmmh... im not a php programmer but i think is normal that an echo must end with the ";" char
So i dont see the problem...
zEitEr
01-24-2012, 11:11 AM
<?php
echo "Please give me an error!<br />"
echo "Can you do that for me?";
?>
With this script, I trigger an internal 500 error.
http://docs.php.net/manual/en/language.basic-syntax.instruction-separation.php
BlueCola
01-26-2012, 12:08 PM
I'm sorry, but I don't think you understand me. This script:
<?php
echo "Please give me an error!<br />"
echo "Can you do that for me?";
?>
should give me an error about the missing ; ( PHP Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in ). But instead of printing this error to the browser, it give's a 500 internal error, and I can see the error in the /var/logs/domain.error.log.
Because my customers don't have access to the /var/ folder, they can't see what they're doing wrong if they make an error.
So, the script above is only an example.
Is there an error in the suphp log too? /var/log/suphp.log
Do you have error display turned on in php.ini?
What error are you seeing in the error log /var/logs/domain.error.log?
Try this on the top of your script to see if it turns on errors:
ini_set('display_errors','on');
BlueCola
01-26-2012, 12:48 PM
Display error was turned off in php.ini. Thank you so much! (:
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.