php -S localhost:8888 creates local server in terminal but browser shows 404

in terminal:

Melindas-MacBook-Pro:MelindaSterne Melinda$ php -S localhost:8888
PHP 7.2.17 Development Server started at Thu Apr 25 13:39:37 2019
Listening on
Document root is /Users/Melinda/Desktop/MelindaSterne
Press Ctrl-C to quit.
[Thu Apr 25 13:39:47 2019] ::1:53355 [404]: / - No such file or directory

This was working for me unitl I installed sass, nodejs, and gulp with Homebrew last night. Today I have ran a

brew update

and

brew cleanup

and it's still not working.

2 Answers

adding an index.php page loaded the page (while index.html did not).

1

This may not be the solution but here are a couple of things help debug or at least gather more info about the problem:

  • double-check that there is some file in /Users/Melinda/Desktop/MelindaSterne that the web server can serve. I think this would be index.htm, index.html, or index.php. However it might has some other name.

  • try to return the system to the working state by removing the brew packages that seem to have broken things: sass, nodejs, and gulp.
    brew uninstall sass
    brew uninstall nodejs
    brew uninstall gulp

    If the php server then starts to work, you can try adding the packages back one by one and checking the php server between each install.

    However if the php server didn't start working after the 3 packages are uninstalled then there is some other issue to look for..

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like