【问题标题】:Why does PHP built-in web server not serve file called é.txt (on Windows)为什么 PHP 内置 Web 服务器不提供名为 é.txt 的文件(在 Windows 上)
【发布时间】:2016-01-14 00:06:19
【问题描述】:

我在 Windows 7 上

如果我有一个包含我的文件 é.txt 的目录,并且我在该目录中启动内置 Web 服务器

php -S localhost:8000

然后,使用我的网络浏览器,我请求 URL

http://localhost:8000/é.txt

网络服务器响应

Not Found

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

【问题讨论】:

  • 如果你去http://localhost:8000/,它会列出目录结构(里面有文件)吗?
  • 不,这也是 404 - 但我认为这是正常的
  • 我做了一个测试:php -S localhost:8000 é.txt试试吧

标签: php utf-8 http-status-code-404 command-line-interface url-encoding


【解决方案1】:

PHP 的 Windows 文件系统支持已损坏 - 它无法正确转换为本机编码。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多