Php 无法在Mac上使用端口80
我正在使用macOS Catalina 10.15版。开始时,我能够使用带有端口80的MAMP-PRO。但是,在我未能在Php 无法在Mac上使用端口80,php,macos,Php,Macos,我正在使用macOS Catalina 10.15版。开始时,我能够使用带有端口80的MAMP-PRO。但是,在我未能在/applications/mamp/htdocts/project/的项目中运行composer install之后,因为PHP缺少扩展名ext-zip,如下所示: Problem 1 - Installation request for phpoffice/phpspreadsheet 1.10.0 -> satisfiable by phpoffice/ph
/applications/mamp/htdocts/project/
的项目中运行composer install
之后,因为PHP缺少扩展名ext-zip,如下所示:
Problem 1
- Installation request for phpoffice/phpspreadsheet 1.10.0 -> satisfiable by phpoffice/phpspreadsheet[1.10.0].
- phpoffice/phpspreadsheet 1.10.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
Problem 2
- phpoffice/phpspreadsheet 1.10.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- maatwebsite/excel 3.1.17 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0].
- Installation request for maatwebsite/excel 3.1.17 -> satisfiable by maatwebsite/excel[3.1.17].
我决定在终端中通过自制安装php
。通过以下命令成功安装后
brew安装php@7.3
#php-v
PHP 7.3.8(cli)(构建时间:2019年8月24日19:38:14)(新南威尔士州)
版权所有(c)1997-2018 PHP集团
Zend Engine v3.3.8,版权所有(c)1998-2018 Zend Technologies
#哪个php
/usr/bin/php
因此,我无法再将MAMP-PRO与端口80一起使用,也无法解决缺少扩展名ext-zip的问题
我有几个问题想不起来:
如果内置php
一直存在,那么在开始时如何使用端口80
带有macOS的内置php
是否始终运行?如何知道项目内部正在使用哪个php?(macOS还是MAMP)
我的尝试:
-尝试卸载我通过brew卸载安装的php
版本php@7.3--force
没有根凭据的普通用户无法使用从1到1024的端口。
您可以使用sudo绑定到端口80,但请注意,使用根凭据启动程序时可能存在一些安全风险,因此请使用绑定到您的特权端口并将用户凭据释放给普通用户的包装器。使用netstat命令检查端口80的繁忙位置。结束这个过程,你就可以开始了。要运行netstat,请在应用程序>实用程序>终端打开终端窗口。键入netstat并按Enter键执行命令。/usr/bin/php
不是自制软件的安装路径(/usr/local/bin
),因此您没有做任何更改,仍然使用“出厂”php。此外,端口使用与php的安装(of not)无关。请参阅本文: