help me to debug the code without ftp access

Discussion in 'PHP' started by nat000, Sep 8, 2009.

  1. #1
    Hi guys,
    The problem is the following:
    2 servers have the same php code+ .htaccess files,
    these files are updated via svn.

    The database is one for both servers.

    The problem is that main server doesn't work as it should. For example, when the user is logged, page is empty.
    I have ftp access only to the test server and have to find the error.

    THANKS
     
    nat000, Sep 8, 2009 IP
  2. caprichoso

    caprichoso Well-Known Member

    Messages:
    433
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #2
    I guess the main server runs a "svn update ." on your demand, doesn't it?

    Is PHP showing warning/error message on HTML? If it isn't, is it logging errors to a file you can see?

    If you can see error output you are lost. All you can do is guess.
     
    caprichoso, Sep 8, 2009 IP
  3. nat000

    nat000 Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    yes, it does


    nothing, just a black page
    I assume this could be a fatal error somewhere in the code, because
    errors reporting turned off on live server
     
    nat000, Sep 8, 2009 IP
  4. caprichoso

    caprichoso Well-Known Member

    Messages:
    433
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Production PHP should log to /var/log/apache/error.log or somewhere else. You need to get that log in oder to solve the problem. It could be anything.
     
    caprichoso, Sep 9, 2009 IP
  5. hugl3

    hugl3 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hello
    try doing something:
    error_reporting(E_ALL);

    and see what happens
     
    hugl3, Sep 9, 2009 IP
  6. caprichoso

    caprichoso Well-Known Member

    Messages:
    433
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #6
    Doing so will activate all error/warning messages. That won't change where those messages are sent.
    If you want those messages to be sent to HTML output you could turn this option via ini_set() -> http://ar2.php.net/manual/en/errorfunc.configuration.php#ini.display-errors

    Doing this to a production system is strongly discouraged.
     
    caprichoso, Sep 9, 2009 IP
  7. nat000

    nat000 Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    Hi guys ,
    I believe I have found the error;

    Can the cookies assigned after some html output produce fatal error?
    On testing server the same code works well. I can also manually add a cookie to my browser and after that the production server shows a blank page

    error_reporting, yes, turned off on production server
     
    nat000, Sep 15, 2009 IP
  8. caprichoso

    caprichoso Well-Known Member

    Messages:
    433
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #8
    Any header or cookie sent after HTML output will produce a warning/error. I don't think a fatal error could be produced.
     
    caprichoso, Sep 15, 2009 IP