-->

Apache htdocs in folder with unicode name

2019-05-01 05:09发布

问题:

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?

回答1:

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.



回答2:

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