Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

453
Views
PHP -S service ? "php -S localhost index.php" image is not displaying on server on localhost

everyone i have php simple some code :


project
 |- index.php
 |- banana.jpg

file: index.php

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

  <img src="banana.jpg" alt="">

</body>
</html>

So, i open command prompt in project folder and run $ php -S localhost:8000 index.php then open browser

but not show my image :(

enter image description here

Please help and tell me about solution way...

Thank you so much

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It must be a bug in the php web server, I did tests with version 8.0.9 and the same thing happens to me, it does not recognize the type.

enter image description here

With php -S localhost: 8000 it works correctly, by default php executes the index.php file

php -S localhost: 8000

If the file is in "public/index.php" you could run:

php -S localhost: 8000 -t public

You can find more information at :https://www.php.net/manual/en/features.commandline.webserver.php

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!