Fix "Cannot bind to port 80" on XAMPP for OSX

When I tried to configure the port of Apache web server on XAMPP for OSX, I met the error message "Cannot bind to port 80. It is probably taken by another application or you don't have enough privileges." Modify the http.conf to bypass the error.

Steps:

After observing the application log:
Starting Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started
Use the text editor to open the file: /Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh
HTTPD="/Applications/XAMPP/xamppfiles/bin/httpd -f /Applications/XAMPP/xamppfiles/etc/httpd.conf"
Use the text editor to open the httpd.conf file. And find this line "Listen <port>"
Listen 80
After modified the httpd.conf file, you should restart the Apache web server so that your changes will take effect.

Versions:

XAMPP-VM / PHP 7.2.9

References:

留言