1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

PHP error message does not show in safari,help!

Discussion in 'Web Design and Development (archive)' started by yklxcq, Oct 21, 2005.

  1. macrumors member

    yklxcq

    #1
    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
     
  2. Moderator emeritus

    Rower_CPU

    #2
    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?
     
  3. macrumors member

    yklxcq

    #3
    <!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
     
  4. Moderator

    Nermal

    Staff Member

    #4
    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.
     
  5. macrumors member

    yklxcq

    #5
    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????
     
  6. Moderator

    Nermal

    Staff Member

    #6
    So you are running two different servers? Are they running different versions of PHP?
     
  7. macrumors member

    yklxcq

    #7
    I am running one server, the apache on my Mac only, with PHP version 5.
     
  8. Moderator

    Nermal

    Staff Member

    #8
    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:
     
  9. macrumors 68030

    superbovine

    #9
    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?
     

Share This Page