PDA

View Full Version : PHP error message does not show in safari,help!


yklxcq
Oct 22, 2005, 01:30 AM
When i have made some syntax error of php in my page, and my windows machine can show some error message,e.g. tell me the line number of the error; however, in Mac os x, i just a blank screen, no error message at all, can someone help me to get the error message function out?
The broswer i am using are FireFox and Safari.
thx

Rower_CPU
Oct 23, 2005, 12:56 AM
The only reason it should doing that is if there are styles or javascript preventing the error from displaying on Mac browsers.

Do you have a page we can look at that does this?

yklxcq
Oct 23, 2005, 05:39 AM
The only reason it should doing that is if there are styles or javascript preventing the error from displaying on Mac browsers.

Do you have a page we can look at that does this?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>php_testing</title>
</head>

<body>
<?php
ini_set('display_errors','1');
$my_array=("one","Two","Three")
foreach ($my_array as $value)
echo "Value is:".$value;
}
?>

</body>
</html>

The code above got syntax error, e.g. $my_array=("one","Two","Three") should be $my_array=array("one","Two","Three"), but when i ran it, all i get is a blank screen, no error message at all

Nermal
Oct 23, 2005, 05:51 AM
Are you connecting to the same server with both Windows and Mac, or are you hosting the PHP page on two different servers (one Windows, one Mac)?

OS 10.3 (Panther) included PHP by default, but 10.4 (Tiger) doesn't seem to have it anymore, and you'll need to install it manually.

yklxcq
Oct 23, 2005, 06:14 AM
The error message is showing now, what i have done is just go to the config file and change display_error=On; however, i found the error message most of time does not make any sence, if the syntax error occurred in line 20, the actual line number most of time always be the line number of my start PHP tag position , and i have try it in windows, same php code, same syntax error, the error line number is different, windows machine gave more accurate line numbers, why????

Nermal
Oct 23, 2005, 06:17 AM
So you are running two different servers? Are they running different versions of PHP?

yklxcq
Oct 24, 2005, 12:37 AM
So you are running two different servers? Are they running different versions of PHP?
I am running one server, the apache on my Mac only, with PHP version 5.

Nermal
Oct 24, 2005, 12:51 AM
OK, I'm completely baffled now. I don't see how your Windows computer was throwing up errors in the first place without the display_errors variable set, let alone why they're giving different line numbers :confused:

superbovine
Oct 24, 2005, 11:01 AM
run the script form the command line on your back and post what output you get. you check your /var/log files also? Also, have you tried testing from a remote Mac instead of the local server?