php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62917 require() fails depending on PHP filename (includes ASCII 'µ' character)
Submitted: 2012-08-24 04:04 UTC Modified: 2012-08-24 09:10 UTC
From: matthew at slyman dot org Assigned:
Status: Duplicate Package: Filesystem function related
PHP Version: 5.4.6 OS: Windows 7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: matthew at slyman dot org
New email:
PHP Version: OS:

 

 [2012-08-24 04:04 UTC] matthew at slyman dot org
Description:
------------
---
From manual page: http://www.php.net/function.require-once
---
Where PHP filename includes "µ" character, for example; calling "require_once" on 
that file results in an error message (require fails). Similar paths/filenames 
without the special ASCII characters work under the same (Windows/XAMPP) 
installation, and identical paths/filenames including the special characters work 
under Linux.

Test script:
---------------
(Create a file called "microtime.php" and another file called "µTIME.php", and put them in the C:/ drive root folder, or some other place where PHP files may be included from.)
~~~
require_once('C:/microtime.php');//works
require_once('C:/µTIME.php');//results in error message, but only under Windows.

Expected result:
----------------
PHP file included.

Actual result:
--------------
ERROR MESSAGE:
~~~
Warning: require_once(C:/htdocs/[path_hidden]/µTIME.php): failed to open stream: 
No such file or directory in C:\htdocs\[path_hidden]\[filename_hidden].php on line 
...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-24 04:11 UTC] matthew at slyman dot org
This is an issue, partly because object/function names are permitted to have 
symbols like "µ", and the object class autoloading system permits files to be 
required automatically (where for example filename is identical to class name 
defined in the PHP file). I haven't tested the autoloading system yet but it would 
be nice to be able to include/require this file using traditional methods at this 
point, and retain the convenient/logical class/file name "µtime" for 
futureproofing.
 [2012-08-24 09:10 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2012-08-24 09:10 UTC] nikic@php.net
This is a known issue. See this mailing list thread: http://www.mail-archive.com/internals@lists.php.net/msg60391.html (and this bug is also related: https://bugs.php.net/bug.php?id=47096).

Basically it comes down to: Don't use Unicode filenames, at least not if you need Windows compat. In http://www.mail-archive.com/internals@lists.php.net/msg60446.html Pierre says that this is planned to be resolved for php-next+1.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC