Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

441
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda