php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #35119 PHP failed to open files in folders with non-english utf8 chars
Submitted: 2005-11-06 01:25 UTC Modified: 2009-08-20 08:33 UTC
From: maltzee at hotmail dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.0.5 OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-11-06 01:25 UTC] maltzee at hotmail dot com
Description:
------------
OS: Windows XP Traditional Chinese

I installed an Apache2 server to a folder with double-byte character. (e.g C:\中國\Apache2\)

To support Apache2, I have to convert the httpd.conf into UTF8 format.

PHP5.0.5 is installed as Apache2 module by httpd.conf.
LoadModule php5_module "C:/中國/Apache2/php-5.0.5-Win32/php5apache2.dll"
AddType application/x-httpd-php .php

When I try to access my test page, the following returned:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Warning: Unknown: Failed opening 'C:\中國\Apache2\htdocs\index.php' for inclusion (include_path='.;C:\php5\pear') in Unknown on line 0 

I guess Apache saves the utf8 path string from httpd.conf and passes them to PHP module. PHP assumes the input path as native mbstring. This might be the cause.

Best Regards,
Maltzee


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-20 01:00 UTC] john dot peterson3 at hotmail dot com
Has anyone found a cause and solution for this? My Apache 2.0.54 and PHP 5.2.9 does the same thing. It can't open php files that reside in any path with two-byte western european letters such as ? (%c3%a5), ? (%c3%a4) or ? (%c3%b6).
 [2009-08-20 08:33 UTC] pajoye@php.net
You have to convert the path to the correct codepage before passing it to the file functions.

php6 will support unicode filenames. Move to won't fix as we already a feature request for that and it is part of the php6 todo.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 10:01:32 2024 UTC