AtomLinter / linter-phpmd

Atom linter plugin for php, using phpmd.
21 stars 4 forks source link

php_imap.so not found on OS X El Capitan #105

Closed sijpkes closed 7 years ago

sijpkes commented 7 years ago

I've installed php71 with homebrew and the --with-imap --with-httpd24 extensions but this module is still missing when I run the linter. I'm not sure why a linter would need IMAP.

Error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_imap.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_imap.so, 9): image not found in Unknown on line 0
Error: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_imap.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_imap.so, 9): image not found in Unknown on line 0
    at ChildProcess.<anonymous> (/Users/ps158/.atom/packages/linter-phpmd/node_modules/sb-exec/lib/index.js:56:20)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)
Arcanemagus commented 7 years ago

That looks to be coming from your php.ini, does phpmd even run from the CLI?

sijpkes commented 7 years ago

@Arcanemagus - yeah, both phpmd and php run perfectly from the CLI. The php.ini does not contain any enabled modules for imap, so I'm wondering if Atom pulls a php.ini from somewhere else...

Arcanemagus commented 7 years ago

This just runs phpmd....

Can you try closing all instances of Atom, then launching Atom from a Terminal window? (atom .)

Arcanemagus commented 7 years ago

Marking as closed due to a lack of response. It's likely you are running into the common macOS bug where the environment you see in Terminal is completely different from that given to GUI applications. Sometimes you can fix this by manually specifying the full path to the "right" phpmd, but often for those hitting this you need to close all instances of Atom and only launch it from the Terminal.