I've searched the internet from top to bottom trying to fix this problem! I can't see error message on php pages!
In the php.ini file the display_errors is on. safe_mode is off. error_reporting is E_ALL ^ E_NOTICE (meaning all errors except notices, this works I've used it on other LAMP servers.)
Here are two files i've created:
http://www.ybhosting.com/test.php source code:
<?php
phpinfo();
?>
http://www.ybhosting.com/test2.php
<?php
d
phpinfo();
?>
The second one does not spit an error message about the character
"d". It just results in a blank page.
I am using virtual server from media-temple. I've restarted the server several times.
Please help! Thanks.
Steve_Arm
09-01-2007, 04:02 PM
Displaying php errors is bad. It might expose valuable information to hackers.
So I would worry for the opposite.
Run this test:
<?php
error_reporting(6143);
d
phpinfo();
?>
ThatScriptGuy
09-01-2007, 04:29 PM
But it's incredibly useful when trying to troubleshoot your own apps.
tersum
09-01-2007, 07:30 PM
If you are using mediatemple's dv try tailing the error log:
tail -f /var/log/httpd/error_log (if that's where your error log is)
If you are using the grid server then I'm sure they provide you with the error log file within the account center.
Displaying php errors is bad. It might expose valuable information to hackers.
So I would worry for the opposite.
Run this test:
<?php
error_reporting(6143);
d
phpinfo();
?>
Hi Steve,
I tried the code stated above. With no luck.
Just now, I tried this in the terminal....
[root@ybhosting httpsdocs]# php -d "error_reporting=6143" test2.php
Content-type: text/html
X-Powered-By: PHP/4.3.9
<br />
<b>Parse error</b>: parse error, unexpected T_STRING in <b>/var/www/vhosts/ybhosting.com/httpsdocs/test2.php (http://ybhosting.com/httpsdocs/test2.php)</b> on line <b>5</b><br />
This gives me the impression that it's a problem with apache...
If you are using mediatemple's dv try tailing the error log:
tail -f /var/log/httpd/error_log (if that's where your error log is)
If you are using the grid server then I'm sure they provide you with the error log file within the account center.
This doesn't display php errors for some reason either. I did however set /var/log/php.log to write out the errors and that doesn't do it either UNTIL I tried it in the terminal!
[root@ybhosting log]# cat php.log
[root@ybhosting log]# php -d "error_reporting=6143" /var/www/vhosts/ybhosting.com/httpsdocs/test2.php
Content-type: text/html
X-Powered-By: PHP/4.3.9
<br />
<b>Parse error</b>: parse error, unexpected T_STRING in <b>/var/www/vhosts/ybhosting.com/httpsdocs/test2.php</b> on line <b>5</b><br />
[root@ybhosting log]# cat php.log
[01-Sep-2007 16:53:04] PHP Parse error: parse error, unexpected T_STRING in /var/www/vhosts/ybhosting.com/httpsdocs/test2.php on line 5
[root@ybhosting log]#
Very weird stuff.
Bangalore Job Mob
09-01-2007, 09:04 PM
So write a custom error handler and fix your broken code.
RESOLVED!
I made a big mess of things. got rid of the .htaccess php_flag that i had. that was messing everything up.
E_ALL ^ E_NOTICE only works in PHP 5.... this server is running PHP 4. This is the first time i deal with virtual hosting and plesk.
Use this instead:
error_reporting = E_ALL & ~E_NOTICE
thanks everyone for all your help!
digirave
09-02-2007, 12:50 AM
error_reporting = E_ALL & ~E_NOTICE
is the easy way, but you really should learn how to go through logs
as mentioned above
tail -f /var/log/httpd/error_log (if that's where your error log is)
Digit_Canada
02-02-2010, 10:51 PM
I had the same problem today, with the blank page. Solved it by parsing all my modifited php using the command line php with the -l switch. It found the syntax error and solved my problem.
Hope this prevents someone else to spend half a day lookging for a syntax error.