macos — установка москита с расширением PHP для [email protected] от homebrew

ОС: MacOS High Sierra 10.13.5

Мой php связан с помощью homebrew:

which php
/usr/local/bin/php

php -v
PHP 7.0.31 (cli) (built: Jul 19 2018 23:41:03) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
with Zend OPcache v7.0.31, Copyright (c) 1999-2017, by Zend Technologies

У меня есть проект на основе PHP, и я пытаюсь вытянуть зависимости через composer install, Я получил:

 Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for pds/solace v1.0.1 -> satisfiable by pds/solace[v1.0.1].
- pds/solace v1.0.1 requires ext-mosquitto * -> the requested PHP extension mosquitto is missing from your system.

To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/7.0/php.ini
- /usr/local/etc/php/7.0/conf.d/ext-opcache.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Поэтому я пытаюсь установить расширение через Pecl с

pecl install Mosquitto-alpha

И я получаю

downloading Mosquitto-0.4.0.tgz ...
Starting to download Mosquitto-0.4.0.tgz (23,804 bytes)
........done: 23,804 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
Please provide the prefix of the libmosquitto installation [autodetect] :
building in /private/tmp/pear/temp/pear-build-skalashnikovtgyrLB/Mosquitto-0.4.0
running: /private/tmp/pear/temp/Mosquitto/configure --with-php-config=/usr/local/opt/[email protected]/bin/php-config --with-mosquitto
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin17.6.0
checking host system type... x86_64-apple-darwin17.6.0
checking target system type... x86_64-apple-darwin17.6.0
checking for PHP prefix... /usr/local/Cellar/[email protected]/7.0.31
checking for PHP includes... -I/usr/local/Cellar/[email protected]/7.0.31/include/php -I/usr/local/Cellar/[email protected]/7.0.31/include/php/main -I/usr/local/Cellar/[email protected]/7.0.31/include/php/TSRM -I/usr/local/Cellar/[email protected]/7.0.31/include/php/Zend -I/usr/local/Cellar/[email protected]/7.0.31/include/php/ext -I/usr/local/Cellar/[email protected]/7.0.31/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/[email protected]/7.0.31/pecl/20151012
checking for PHP installed headers prefix... /usr/local/Cellar/[email protected]/7.0.31/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for mosquitto support... yes, shared
checking for mosquitto files in default path... not found
configure: error: Please reinstall the mosquitto distribution
ERROR: `/private/tmp/pear/temp/Mosquitto/configure --with-php-config=/usr/local/opt/[email protected]/bin/php-config --with-mosquitto' failed

0

Решение

Я смог найти решение .. пришлось выполнить:

brew install mosquitto

который установлен mosquitto и все зависимости

==> Установка зависимостей для комаров: c-ares, openssl, libev, libuv, libevent, libwebsockets

==> Установка москита

==> Резюме
�� /usr/local/Cellar/mosquitto/1.4.14_2: 33 файла, 629,9 КБ

А потом казнил

pecl install Mosquitto-alpha

который успешно установил php lib и связал его

загрузка Mosquitto-0.4.0.tgz … Начинаем скачивать
Mosquitto-0.4.0.tgz (23 804 байта) …….. сделано: 23 804 байта

Процесс сборки успешно завершен

Установка
‘/Usr/local/Cellar/[email protected]/7.0.31/pecl/20151012/mosquitto.so’

устанавливать
хорошо: канал: //pecl.php.net/Mosquitto-0.4.0

Расширение москита включено
в php.ini

0

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]