macOS 缺失的软件包的管理器
对于我们这些程序狗们,在 MacOSX 中安装使用一些开发服务工具,最方便的方式就是使用 Homebrew 了。
最近我用 brew 安装了 php55-pthread 这个扩展,结果发现php报错,说
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php55-igbinary/igbinary.so' - dlopen(/usr/local/opt/php55-igbinary/igbinary.so, 9): Symbol not found: _basic_globals
Referenced from: /usr/local/opt/php55-igbinary/igbinary.so
Expected in: flat namespace
in /usr/local/opt/php55-igbinary/igbinary.so in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php55-igbinary/igbinary.so' - dlopen(/usr/local/opt/php55-igbinary/igbinary.so, 9): Symbol not found: _basic_globals
Referenced from: /usr/local/opt/php55-igbinary/igbinary.so
Expected in: flat namespace
in /usr/local/opt/php55-igbinary/igbinary.so in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php55-redis/redis.so' - dlopen(/usr/local/opt/php55-redis/redis.so, 9): Symbol not found: _basic_globals
Referenced from: /usr/local/opt/php55-redis/redis.so
Expected in: flat namespace
in /usr/local/opt/php55-redis/redis.so in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php55-redis/redis.so' - dlopen(/usr/local/opt/php55-redis/redis.so, 9): Symbol not found: _basic_globals
Referenced from: /usr/local/opt/php55-redis/redis.so
Expected in: flat namespace
in /usr/local/opt/php55-redis/redis.so in Unknown on line 0
最终还是在万能的搜索帮助下,解决了这个问题
brew remove php55-igbinary php55-redis
brew reinstall php55 --enable-maintainer-zts --build-from-source php55-igbinary --build-from-source php55-redis --build-from-source
记录一下,下次再出问题就好办了。
参考:Installing php56-pthreads broke previously installed extensions