Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

yklxcq

macrumors member
Original poster
Jun 22, 2005
81
0
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

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
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

macrumors member
Original poster
Jun 22, 2005
81
0
Rower_CPU said:
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

Moderator
Staff member
Dec 7, 2002
20,638
4,036
New Zealand
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

macrumors member
Original poster
Jun 22, 2005
81
0
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????
 

yklxcq

macrumors member
Original poster
Jun 22, 2005
81
0
Nermal said:
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

Moderator
Staff member
Dec 7, 2002
20,638
4,036
New Zealand
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

macrumors 68030
Nov 7, 2003
2,872
0
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?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.