Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't start httpd - Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/*/Library/LaunchAgents/homebrew.mxcl.httpd.plist` exited with 5

Tags:

apache

Just tried accessing my localhost today, but it doesn't work. I worked yesterday, but I believe it's because my Mac crashed. I've tried started httpd again with brew services start httpd. This results in:

Bootstrap failed: 5: Input/output error Try re-running the command as root for richer errors. Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/UserName/Library/LaunchAgents/homebrew.mxcl.httpd.plist exited with 5.

Have tried reinstalling httpd, but it still gives the same error. Any ideas what the cause can be?

like image 768
badbeat1 Avatar asked Sep 02 '25 17:09

badbeat1


2 Answers

I had the same problem after I upgraded to macOS Monterey. But I solved my issue via these commands.

Unload homebrew.mxcl.httpd.plist

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist

And then load it again:

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist

After that I used this command to start httpd again.

brew services start httpd
like image 131
Sophy Avatar answered Sep 04 '25 09:09

Sophy


Just thought I'd share what worked for me for anyone else still stuck...

It seemed I had a version of apache running which was stopping the brew version. (thought I'd removed the built in apache already!).

This also happened after my Mac crashed and got the exact same error message but I did:

Stop brew httpd service completely

brew services stop httpd   

Stop Mac Apache leftovers

sudo apachectl -k stop

Start brew httpd again

brew services start httpd

Started like a charm and solved my issue.

like image 28
Fez Avatar answered Sep 04 '25 09:09

Fez