Ubuntu – Failed to listen on 127.0.0.1:80 (reason: Permission denied) PhpStorm Xdebug

permissionsPHPwebserver

I have been using phpstorm to develop PHP applications in windows. I shifted to Ubuntu because a friend suggested. I recently configured Xdebug with PHPStorm, but I am unable to try it because it is given me this error:

Failed to listen on 127.0.0.1:80 (reason: Permission denied)

I am using PHPStorm 2016.2. It is running without debugging, but when I try to run in Web Server for debugging it gives this error

ANy help would be highly appreciated.

Best Answer

Try executing command as follows to check whether port 80 is already used by other program.

ss -nltp | grep -iw 80

If the above command is not found in your ubuntu (older ubuntu version doesn't have the ss command) then try following cmd.

 netstat -nltp | grep -iw "80"

If port 80 is used by any application , it will be listed there . If you found so then you need to first stop that application or else you need to change the port of that application to something else other than port 80. Atfer that try running your application so it can easily bind to port 80.

Related Question