8

I created a dir named "test", and inside this dir, i created 3 files: 1.jpg, 2.html and 3.php. If i run php -S localhost:80 and try to visit localhost/3.php, it works. But if i visit 1.jpg or 1.html, or any file that is not a php, it gives me a 404 not found error. I'm using PHP 7.1 NTS on Windows 10. I tried with PHP TS and PHP 7.2 but the error persists.

enter image description here

André
  • 185
  • 6

2 Answers2

5

The issue may be caused by the accented e in your file path, please test in a different location. Why does PHP built-in web server not serve file called é.txt (on Windows)

Jacob Mulquin
  • 3,458
  • 1
  • 19
  • 22
1

I had a similar problem: my php page would display fine but no other page, including images on the php page would be served. The problem was asking the php development server to serve a specific page:

php -S 127.0.0.1:8000 myPage.php

Rather than:

php -S 127.0.0.1:8000

In the later I have to include myPage.php in the url, but images and other files now display.

user1794469
  • 228
  • 4
  • 17