1

I'm using macOS Catalina version 10.15. At the beginning, I was able to use MAMP PRO with Port 80. However, after I failed to run composer install inside a project at /applications/mamp/htdocts/project/ because of a missing extension ext-zip of PHP as below:

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].

I decided to install php via homebrew in Terminal. After successfully installed by the following commmand

brew install php@7.3
# php -v
PHP 7.3.8 (cli) (built: Aug 24 2019 19:38:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
#which php
/usr/bin/php

As a result, I cannot use MAMP PRO with Port 80 anymore nor does it resolve the missing extension ext-zip problem.

I have a couple questions that cannot wrap my head around:

  1. If the built-in php has been always there, how could I use the Port 80 in the beginning?
  2. is the built-in php with macOS always running? How to know inside of a project that which php is being used? (macOS or MAMP)??

What I have tried:
- Attempt to uninstall php version that I have installed by brew uninstall php@7.3 --force.

pucca garu
  • 49
  • 5
  • 3
    use netstat command to check where your port 80 is busy. Kill that process and you'll be good to go. To run netstat, open a Terminal window at Applications > Utilities > Terminal. Type netstat and press Enter to execute the command. – Hassaan Ali Jan 15 '20 at 10:11
  • `/usr/bin/php` is not the install path for homebrew (`/usr/local/bin`), so you have changed nothing and are still using the 'as shipped' php. Also, port use is not related to the installed (of not) of php. – YvesLeBorg Jan 15 '20 at 10:27
  • Check this article: https://stackoverflow.com/questions/26585116/the-port-80-in-mac-is-used – mitkosoft Jan 15 '20 at 10:36

1 Answers1

1

Ports from 1 to 1024 cannot be used by normal users without root credentials. You would be able to use sudo to bind to port 80, but be aware, there could be some security risks when starting a program with root credentials, so use a wrapper which binds to your privileged port and relaxes the user credentials to a normal user.