簡體   English   中英

在 MAMP Pro 中安裝 zip 擴展

[英]Install zip extension in MAMP Pro

我正在運行 MAMP Pro 並嘗試安裝 zip 擴展,並收到以下錯誤:

MacBook-Pro:bin michaelharrison$ pecl install zip
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading zip-1.15.5.tgz ...
Starting to download zip-1.15.5.tgz (286,794 bytes)
............................................................done: 286,794 bytes
14 source files, building
running: phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
building in /private/tmp/pear/temp/pear-build-michaelharrisonllhfLo/zip-1.15.5
running: /private/tmp/pear/temp/zip/configure --with-php-config=/Applications/MAMP/bin/php/php7.2.1/bin/php-config
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-darwin19.0.0
checking host system type... x86_64-apple-darwin19.0.0
checking target system type... x86_64-apple-darwin19.0.0
checking for PHP prefix... /Applications/MAMP/bin/php/php7.2.1
checking for PHP includes... -I/Applications/MAMP/bin/php/php7.2.1/include/php -I/Applications/MAMP/bin/php/php7.2.1/include/php/main -I/Applications/MAMP/bin/php/php7.2.1/include/php/TSRM -I/Applications/MAMP/bin/php/php7.2.1/include/php/Zend -I/Applications/MAMP/bin/php/php7.2.1/include/php/ext -I/Applications/MAMP/bin/php/php7.2.1/include/php/ext/date/lib
checking for PHP extension directory... /Applications/MAMP/bin/php/php7.2.1/lib/php/extensions/no-debug-non-zts-20170718
checking for PHP installed headers prefix... /Applications/MAMP/bin/php/php7.2.1/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 zip archive read/writesupport... yes, shared
checking libzip... yes
checking PHP version... 7.0/7.1/7.2
checking for pkg-config... no
checking for libzip... not found
configure: error: Please reinstall the libzip distribution
ERROR: `/private/tmp/pear/temp/zip/configure --with-php-config=/Applications/MAMP/bin/php/php7.2.1/bin/php-config' failed
MacBook-Pro:bin michaelharrison$ 

看起來我缺少libzip distribution ,但我找不到有關如何解決此問題的信息。 我需要 zip 擴展來安裝 Statamic 插件。 我不知道 go 從這里到哪里....任何幫助表示贊賞。

首先對不起我的英語,我是巴西人,我沒有寫作經驗。

我在版本 5.5.1 上安裝了 MAMP PRO,其中 PHP 7.2.21 我檢查了“使此版本在命令行上可用”選項。

在命令行我去了文件夾
“/Applications/MAMP/bin/php/php7.2.21/lib/php/extensions/no-debug-non-zts-20170718/”
並運行命令pecl install zip安裝成功。

我通過 Mamp PRO 編輯了php.ini文件並啟用了擴展:
extension=/Applications/MAMP/bin/php/php7.2.21/lib/php/extensions/no-debug-non-zts-20170718/zip.so

我禁用了 XDebug 擴展。

我重新啟動了 MAMP 服務。

檢查 PHP 版本:在命令提示符下,我運行了 php -v

PHP 7.2.21 (cli) (built: Aug 14 2019 16:40:59) (NTS) Copyright (c) 1997-2018 The PHP Group Zend Technologies 1998), 版權所有

檢查 ZIP 庫版本php --re zip | grep zip 擴展[擴展#47 zip 版本 1.15.4] {

執行命令laravel new <name>時,zip 庫錯誤繼續。

Error
The Zip PHP extension is not installed. Please install it and try again.

為了解決我強制 laravel 命令執行的 PHP 的版本

vim ~/.composer/vendor/laravel/installer/laravel

我將第一行從#!/usr/bin/env php#./usr/bin/env /Applications/MAMP/bin/php/php7.2.21/bin/php

這在這里運作良好。

我希望它對你有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM