Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not open input file : localhost:8080

On Windows, to run the PHP web server from the command prompt I type:

php -s localhost:80800 -t public

And I get this error:

Could not open input file : localhost:8080

And yet cmd php test.php will echo the text. Why?

like image 800
rog wool Avatar asked Jun 06 '26 15:06

rog wool


2 Answers

It was just the capital S.

php -S localhost:8888 -t public

Now I can see the page in a browser.

I had to cd to the right directory ...and public has an index.php file.

like image 75
rog wool Avatar answered Jun 09 '26 05:06

rog wool


It will work without using XAMPP/WAMP or any other external server, as PHP has its own server inbuilt. You have done a mistake in typing s in php -s localhost:80800.

This command will work - php -S localhost:80800.

"s" in the command will be capital, not small...

like image 20
Meet Lukka Avatar answered Jun 09 '26 05:06

Meet Lukka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!