Why does PHP built-in web server not serve file ca

2019-05-27 11:01发布

问题:

I'm on Windows 7

If I have a directory containing my file é.txt and I start the built-in web server in that directory

php -S localhost:8000

then, using my web browser, I request the URL

http://localhost:8000/é.txt

the web server responds

Not Found

The requested resource /%C3%A9.txt was not found on this server.

回答1:

PHP's Windows filesystem support is broken - it does not properly translate to the native encoding.

See How do I use filesystem functions in PHP, using UTF-8 strings?