Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1467

PHP driver on big endian platform not connecting to MongoDB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 1.6.9
    • Fix Version/s: 1.6.11
    • Component/s: pecl-mongo
    • Labels:
      None
    • Environment:
    • # Replies:
      15
    • Last comment by Customer:
      false
    • Sprint:
      PHP Sprint 23

      Description

      I built the PHP MongoDB driver on a Linux Z system (big endian) but have not been able to get it to connect to MongoDB.

      When i invoke the MongoClient constructor in PHP, to create a connection, the MongoDB server reports "recv(): message len 1040187392 is invalid."
      The value 1040187392 turns out to be hex 3E000000 i.e. would have value 62 (0x3E) with endianess reversed.

      I also built the php MongoDB driver on a x86 machine (little endian) and it connects successfully to the same MongoDB server that was used above.

      I ran tshark (wireshark) on the db server and it reported activity when trying to connect from both Linux Z and x86 systems. When connecting from x86 it reported a "MONGO" message with "Len=62" when the connection is made, but did not recognise any "MONGO" message when connecting from the Linux Z system.

      Hence I seem to have an endianess problem with the PHP driver on the Linux Z system.

      I installed the php driver using a manual source compile and install on each system ('phpize', './configure', 'make', 'sudo make install').

      './configure' reported the following:
      On Z system "checking whether byte ordering is bigendian... yes"
      On x86 system "checking whether byte ordering is bigendian... no"

      Please could you suggest a fix for this problem.

      Thanks

        Attachments

          Activity

            People

            Assignee:
            jmikola Jeremy Mikola
            Reporter:
            d8jeffr David Jeffreys
            Participants:
            Last commenter:
            Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              4 years, 41 weeks ago
              Date of 1st Reply: