skip to Main Content

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?

8

Answers


  1. Chosen as BEST ANSWER

    So after trying a lot of things, this seemed to work:

    Trying what Volex suggests here (brew services. Cant start service. get "Bootstrap failed: 5: Input/output error") gave me a more precise error message.

    The new error message led me to this: apache doesn't work after upgrade of macOs Sierra brew reinstall apr-util fixed the problem.


  2. 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
    
    Login or Signup to reply.
  3. After trying ALL the solutions proposed all over the place, what finally did it for me was changing the owner of the log files in /usr/local/var/log/httpd to my user, instead of root.

    sudo chown [username] *

    This took me hours to figure out, sadly – I even removed and reinstalled httpd (which was actually a good thing, because there was a n older version’s keg knocking around back there).

    Login or Signup to reply.
  4. 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.

    Login or Signup to reply.
  5. In some cases will help restart HTTPD.

    brew services restart httpd
    

    It happens to me when the PC crashes for some reason and httpd is running, but localhost is "down".
    Or you can stop httpd and restart PC. Then start httpd and it’s ok.

    Login or Signup to reply.
  6. I had the same problem after any Restart my Macbook.
    I’m using Macbook Air m1 and Monterey OS version.

    I have solved my problem with these 4 command

    At first run:

    sudo apachectl -k stop
    

    After that run these three command:
    (note: do not run as sudo)

    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist
    
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist
    
    brew services start httpd
    

    Then you can see run services with command below:

    brew services list
    
    Login or Signup to reply.
  7. for me I got quite same problem once I have tried to start postgresql forgetting that I have already started it, after stopping it and started it again it worked

    user@users-MacBook-Pro ~ % brew services start postgresql
    Warning: Use postgresql@14 instead of deprecated postgresql
    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/user/Library/LaunchAgents/[email protected]` exited with 5.
    user@users-MacBook-Pro ~ % brew services stop postgresql 
    Warning: Use postgresql@14 instead of deprecated postgresql
    Stopping `postgresql@14`... (might take a while)
    ==> Successfully stopped `postgresql@14` (label: homebrew.mxcl.postgresql@14)
    user@users-MacBook-Pro ~ % 
    user@users-MacBook-Pro ~ % brew services start postgresql
    Warning: Use postgresql@14 instead of deprecated postgresql
    ==> Successfully started `postgresql@14` (label: homebrew.mxcl.postgresql@14)
    user@users-MacBook-Pro ~ % 
    
    Login or Signup to reply.
  8. Deleting access_log and error_log in the log directory may help you reproduce the problem as sometimes those files are not writable.

    After deleting them, those files will be created by the user and the error will be logged there.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search