![](/img/trans.png)
[英]Problem installing sqlsrv and pdo_sqlsrv extension for php@7.0
[英]PHP extension mosquitto installation for php@7.0 from homebrew
操作系統:MacOS High Sierra 10.13.5
我的php是通過自制程序鏈接的:
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/php@7.0/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/php@7.0/7.0.31
checking for PHP includes... -I/usr/local/Cellar/php@7.0/7.0.31/include/php -I/usr/local/Cellar/php@7.0/7.0.31/include/php/main -I/usr/local/Cellar/php@7.0/7.0.31/include/php/TSRM -I/usr/local/Cellar/php@7.0/7.0.31/include/php/Zend -I/usr/local/Cellar/php@7.0/7.0.31/include/php/ext -I/usr/local/Cellar/php@7.0/7.0.31/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php@7.0/7.0.31/pecl/20151012
checking for PHP installed headers prefix... /usr/local/Cellar/php@7.0/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/php@7.0/bin/php-config --with-mosquitto' failed
我能夠找到解決方案..必須執行:
brew install mosquitto
哪個安裝了mosquitto
和所有依賴項
==>為mosquitto安裝依賴項:c-ares,openssl,libev,libuv,libevent,libwebsockets
...
==>安裝mosquitto
==>摘要🍺/usr/local/Cellar/mosquitto/1.4.14_2:33個文件,629.9KB
然后執行
pecl install Mosquitto-alpha
哪個成功安裝了PHP庫並鏈接了它
正在下載Mosquitto-0.4.0.tgz ...開始下載Mosquitto-0.4.0.tgz(23,804字節)........完成:23,804字節
...
構建過程成功完成
安裝'/usr/local/Cellar/php@7.0/7.0.31/pecl/20151012/mosquitto.so'
安裝確定:channel://pecl.php.net/Mosquitto-0.4.0
在php.ini中啟用了擴展名mosquitto
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.