Apache htdocs 位于具有 unicode 名称的文件夹中
我的 apache(适用于 Windows)htdocs 位于 c:\anything1\怘怙怚怛\anything2 之类的文件夹中。问题是,在这种情况下,php 不会从这里执行任何脚本,并且会显示如下错误消息:
`警告:未知:无法打开流:第 0 行未知中没有这样的文件或目录致命
错误:未知:无法打开第 0 行未知中所需的 'c:/anything1/怘怙怚怛/anything2/index.php' (include_path='.;C:\php5\pear') `
如果我尝试打开一个 html 文件,它是由 apache 提供服务的,所以看来问题只出现在 php 中。 您知道如何解决这个问题吗?
I have my apache (for windows) htdocs in a folder like c:\anything1\怘怙怚怛\anything2. The problem is that in this case php won't execute any scripts from here and will display an error message like this:
`Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'c:/anything1/怘怙怚怛/anything2/index.php' (include_path='.;C:\php5\pear') in Unknown on line 0
`
If I try to open a html file, it is served by apache, so it seems that the problem appears only with php.
Do you have an idea how to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可能是错的,但我想说如果不修补 PHP 就无法做到这一点。 Apache(或 PHP apache 处理程序)向 PHP 传递以 UTF-8 编码的路径,而 PHP 最终依赖于 ANSI 版本的 FindFirstFile(并且您无法设置 UTF-8 代码页)。
我建议您提交错误报告。
I may be wrong but I'd say you can't do it without patching PHP. Apache (or the PHP apache handler) passes PHP a path encoded in UTF-8 and PHP ultimately relies on the ANSI version of FindFirstFile (and you cannot set a UTF-8 codepage).
I suggest you submit a bug report.
我有同样的问题,
阅读更多内容@ http://www. oneminuteinfo.com/2011/02/solve-php-failed-to-open-stream-error.html
这可能对你有帮助
i have same problem,
Read more @ http://www.oneminuteinfo.com/2011/02/solve-php-failed-to-open-stream-error.html
it may be help you