Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

HussainAwaisSajjad's avatar

windows terminal gives error in opening php browser

on giving command (php -s localhost:8888) windows terminal gives an error(could not open input file: localhost:8888) can anyone please help me about this!!!

0 likes
7 replies
MHasnainJafri's avatar

this command will run the server but in browser you have to call file you want to run this will nor run index.php or home.php by default you have to give a file to server like localhost:8888/index.php if this not work then there may be issue with the files permission give them appropriate permissions

woddell's avatar

@HussainAwaisSajjad That's not the issue... The issue is you've used lowercase s instead of uppercase when running the php command.

woddell's avatar

@HussainAwaisSajjad What error are you seeing now? could not open input file: localhost:8888 Is happening because you're using -s instead of -S.

woddell's avatar
  -s               Output HTML syntax highlighted source.
  -S <addr>:<port> Run with built-in web server.

You're using the wrong option (lowercase instead of uppercase)

Please or to participate in this conversation.