OSX: Failed to listen on localhost: 80 (reason: permission denied)

I downloaded PhpStorm and installed all the necessary configuration. When I try to start a project on port 80, I get this error.

Failed to listen on localhost: 80 (reason: permission denied)

And when I try to use any other ports, for example 8080, I get this error.

Failed to listen on localhost: 8080 (reason: address is already in use)

I tried several different random ports. But I use this error all the time.

I have xampp installed. And when I try to run url in browser with port, it works fine. The problem is that it does not work with PhpStorm.

I am stuck.

+5
source share
4

:

:

: 80 (: )

  • ; sudo .

:

: 8080 (: )

  • , localhost:8080, / .

, , : (, 9090).


, , 80 Unix (Mac OSX, Linux), lsof:

:

:

sudo lsof -i :80

- :

COMMAND    PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
httpd       82   root    4u  IPv6 0x763617bed21ecc33      0t0  TCP *:http (LISTEN)
httpd      226   _www    4u  IPv6 0x763617bed21ecc33      0t0  TCP *:http (LISTEN)

, /usr/sbin/httpd 80 , Apache.

, 80, ps:

ps u PID_of_target_process

, :

USER   PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
root    82   0.0  0.0  2463324   4248   ??  Ss    9:48AM   0:00.93 /usr/sbin/httpd -D FOREGROUND

pid, kill, :

sudo kill -KILL PID_of_target_process

, , .

+2
  • Apache XAMPP.

  • PHPStorm ROOT.

PHPStorm , Failed to listen on localhost:8080 (reason: Address already in use). ports 80 . . 80 phpstorm.

0

Xampp Mac

, apache, - Apache!

...... type.....

sudo apachectl

...... ......

sudo/ /XAMPP/xamppfiles/bin/apachectl start

..... if you have a port that is not specified, you need to go to the /xampp/xamppfiles/etc/httpd.conf applications, and on line 52 or 53 you have an IP address or localhost that you can install. add port number add: example port number 192.168.64.2:80 or localhost: 80 saving and starting sudo / Applications / XAMPP / xamppfiles / bin / apachectl start}}}}}}}}}}}}}

0
source

Source: https://habr.com/ru/post/1622505/


All Articles