Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1298

PECL driver fails to install in macOS Mojave because /usr is SIP-protected by macOS

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.5.3
    • Component/s: Docs
    • None
    • Environment:
      macOS Mojave 10.14.1, Apache 2.4.34, PHP 7.1.19 and 7.2

      A few days ago I installed MongoDB quickly and started testing it fine in macOS Mojave. (Under 1 hr)

      But I failed to install the Mongo PHP driver. (About 14 hrs)

      The PHP driver for MongoDB uses PECL and tries to install files in /usr. Mojave's SIP prevents even sudo from writing to /usr except to /usr/local. (Other products I installed knew to write to /usr/local.)

      Disabling SIP then manually copying relevant files to /usr sub-directories allowed the Mongo PHP driver to work but only until re-enabling SIP, which again stopped Mongo PHP driver. (I had also upgraded to PHP 7.2.x but after the failure reverted to macOS stock 7.1.9.)

      Online postings about getting the PHP mongo driver to run are dumpster fires of rube goldberg modifications using Homebrew, PECL, XAMPP, MacPorts, curling, and .conf edits galore.

      For someone like me evaluating mongodb, which works well so far, the lame PHP driver installer paints of picture of a barely or unsupported driver. The purpose of package installers is to make things easier, not leave users to StackExchange groping for solutions for hours.

      Mojave's been out for months and was beta long before that. It's baffling that the PECL and/or Mongo PHP driver developers haven't accounted for the /usr limitations (and perhaps others), unless the driver is dying. Maybe they're doing it for free but certainly not for the love of it.

      Also, I couldn't submit a complaint/bug report to PECL or PHP without including a patch, so they've "successfully" walled themselves off from most feedback from their lusers. 

      If the mongo php driver download page had a warning in the online doc or forums about this problem, it'd at least show the developers are aware and trying. 

      Ugh. I'll use the python driver instead.

       

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jwgmongodb John Gordon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: