I am using a Laravel
package to connect to a payment system and this particular package sends and receives data via port 80 (and as I use port 8000 to make payments, I will encounter failures).
As seen here:
How to run laravel 5 on port 80 of localhost?
I decided to give it a try but this error is returned:
Failed to listen on 127.0.0.1:80 (reason: Permission denied)
To discover which program is using port 80, I entered sudo lsof -i :80
and received the following output:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
apache2 3102 root 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3103 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3104 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3105 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3106 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3107 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3108 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3115 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3116 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
apache2 3117 www-data 4u IPv6 46970 0t0 TCP *:http (LISTEN)
I also tried the command: sudo netstat -nltp | grep -iw "80"
and the following is its output:
tcp6 0 0 :::80 :::* LISTEN 3102/apache2
To free port 80 I tried: sudo kill -9 3102
, afterwards I ran: sudo netstat -nltp | grep -iw "80"
and the output was:
tcp6 0 0 :::80 :::* LISTEN 3330/apache2
(the port is re-occupied).
I very much like to know how I can use port 80 to develop my Laravel app on it (I am using Debian 9 Stretch
).