Announcement

Collapse
No announcement yet.

Strange time problem on ForumHome

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange time problem on ForumHome

    We seem to have a very odd problem on the forum homepage (only) - the time of the last post for each forum is randomly jumping forward an hour - if you refresh the page, sometimes it's correct, sometimes it jumps forward an hour again.

    I cannot see any pattern to this, it's not plugin related as I've disabled them and tried it - same result. It doesn't happen anywhere else on the forum as far as I can tell. The only other clue is that it only seems to have started since Summer Time kicked in.

    Does anyone have a clue whats happening here - it seems to be a vb issue, but I can't pin it to anything atm.

    edit: Also, the time shown at the bottom of the page is always correct (as GMT + 1).
    Baby, I was born this way

  • #2
    As vBulletin fetches the time from PHP, I'd tend towards it being a server problem.
    Does the time in the footer change too?
    Best Regards
    Colin Frei

    Please don't contact me per PM.

    Comment


    • #3
      Originally posted by Colin F
      Does the time in the footer change too?
      No (see my edit).

      If it was a server problem then I would expect it to happen everywhere, not just on the forum homepage.
      Baby, I was born this way

      Comment


      • #4
        Can you duplicate this on a default test installation?
        Best Regards
        Colin Frei

        Please don't contact me per PM.

        Comment


        • #5
          Hmm, on the same box I can.

          A bit of debugging shows that the server is randomly returning different information from this call ;

          date('Z', TIMENOW)

          Sometimes this is 0, sometimes 3600 (3600 is the correct figure).

          Any ideas ?
          Baby, I was born this way

          Comment


          • #6
            I'm not sure what that would be.
            You can report it in the bug tracker if you like, that way one of the devs will look into it.
            Best Regards
            Colin Frei

            Please don't contact me per PM.

            Comment


            • #7
              It's a PHP problem not a vBulletin problem since date is a PHP function and TIMENOW is simply a define of another PHP function to save multiple calls.

              Something could have tainted the environmentals for the apache process, what version of PHP are you using? I've seen this in the PHP Bug Tracker before where a PHP script sets the TZ environmental and it wasn't released at the end. Though it could be any script on the server.
              Scott MacVicar

              My Blog | Twitter

              Comment


              • #8
                Server Type: Linux
                Web Server: Apache v2.0.53
                PHP: 4.4.2

                What's even more bizarre is that if I output the TZ information in both global_start and global_complete - it's always correct in global_complete and varies at global_start

                One example ;
                Start: Server TZ = 0, Time = 1145449520
                Complete: Server TZ = 3600, Time = 1145449520
                then next time ;
                Start: Server TZ = 3600, Time = 1145449525
                Complete: Server TZ = 3600, Time = 1145449525
                Server TZ is this call date('Z',TIMENOW)
                Baby, I was born this way

                Comment


                • #9
                  You are using

                  getenv('TZ') to fetch the timezone environemtal, correct?
                  Scott MacVicar

                  My Blog | Twitter

                  Comment


                  • #10
                    Originally posted by Scott MacVicar
                    You are using

                    getenv('TZ') to fetch the timezone environemtal, correct?
                    No, I'm using the same as vB - date('Z') - I get nothing at all from getenv('TZ').
                    Baby, I was born this way

                    Comment


                    • #11
                      You are using date and not vbdate, right?

                      Also what happens if you restart Apache?
                      Scott MacVicar

                      My Blog | Twitter

                      Comment


                      • #12
                        Originally posted by Scott MacVicar
                        You are using date and not vbdate, right?
                        Yes, I'm using the exact call as taken from this line in functions.php

                        $vbulletin->options['hourdiff'] = (date('Z', TIMENOW) / 3600 - $vbulletin->userinfo['tzoffset']) * 3600;

                        Originally posted by Scott MacVicar
                        Also what happens if you restart Apache?
                        That appears to have stopped it for the moment - but it's been doing it for a while, even after a couple of re-boots so expect it will start again. I guess this means something is affecting apache/php ?

                        I have to go out now, I'll check back later.
                        Baby, I was born this way

                        Comment


                        • #13
                          Ok some script / program is polluting one of your Apache processes, the reason it only appears sometimes is that you usually get a different child process on each request. It will be a script on your server though its hard to guess what.

                          Any chance you can upgrade Apache to 2.0.55? I'll have another look through the PHP bug tracker to see if anything appears.
                          Scott MacVicar

                          My Blog | Twitter

                          Comment


                          • #14
                            The thing that strikes me is it's always correct on the global_complete hook, even when it's wrong on the global_start hook, so something in vB seems to be fixing it - something common, and quite early, it only seems to be apparent on the forumhome. Threads always display correctly.

                            As far as apache goes - we use plesk754 with yum updates from Atomic Turtle, and 2.0.53 is the current offering.
                            Baby, I was born this way

                            Comment


                            • #15
                              I can't actually think of a way we could be fixing this, date is an internal PHP function and there isn't a way for a PHP script to set the date / time on the server.

                              Are you using any sort of Opcode cache like Zend Accelerator / eAccelerator / APC etc?
                              Scott MacVicar

                              My Blog | Twitter

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X