Bug #50203 [Opn->Dup]: Apache +mod_php can't load script with non-ASCII name
| From: | pajoye@php.net | Date: | Thu, 17 Mar 2011 13:13:23 +0000 |
| Subject: | Bug #50203 [Opn->Dup]: Apache +mod_php can't load script with non-ASCII name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-159556@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50203&edit=1
ID: 50203
Updated by: pajoye@php.net
Reported by: vadim at sukhomlinov dot ru
Summary: Apache +mod_php can't load script with non-ASCII
name
-Status: Open
+Status: Duplicate
Type: Bug
Package: Apache2 related
Operating System: win32 only - Windows XP SP3
PHP Version: 5.3.0
Block user comment: N
Private report: N
New Comment:
There is already a feature request for Unicode Filesystem support. And
no, it is
not implemeneted yet.
Previous Comments:
------------------------------------------------------------------------
[2011-03-17 14:08:30] lost dot guadelenn at gmail dot com
The bug is still present in php 5.3.5 and apache 2.2.17.
(Both are latest stable versions).
OS is Win7 64 bit (php and apache are 32-bit).
------------------------------------------------------------------------
[2011-01-17 21:58:26] tsanchev at gmail dot com
Directory listing from pache:
Index of /cosmetic-academy
Parent Directory
assets/
pl0_p0_ÐозмеÑик Ðкадеми_html.php
ддадада д аÑд аÑдdasdasd aдаÑÑÑÑ.txt
when try to execute the sctript in the directory i get this error:
Warning: Unknown: failed to open stream: No such file or directory in
Unknown on
line 0
Fatal error: Unknown: Failed opening required 'D:/web/www/cosmetic-
academy/pl0_p0_ÐозмеÑик Ðкадеми_html.php'
(include_path='.;C:\php5\pear') in
Unknown on line 0
if the name contain only ascii chars it works perfectly
------------------------------------------------------------------------
[2009-11-17 10:30:38] vadim at sukhomlinov dot ru
Description:
------------
When I use Apache 2.2.14 + PHP 5.3 standalone and request such script
directly by name it doesn't start (at least with mod_php), but in log
files I see something like:
[error] [client 127.0.0.1] PHP Fatal error: Unknown: Failed opening
required
'E:/www/test2/\xd0\x9d\xd0\xbe\xd0\xb2\xd0\xbe\xd1\x81\xd1\x82\xd0\xb8.php'
(include_path='.;C:\\php5\\pear') in Unknown on line 0, referer:
http://test2.ru/
I discovered this is because PHP doesn't translate UTF-8 filename passed
from Apache to coding (Unicode-16?) used by Windows, and thus can't open
it. It works perfectly on Linux as Apache, PHP & Linux filesystem use
same UTF-8...
Having this feature is useful for creating SEO-optimized sites with URLs
containing keywords. I don't ask to fix Unicode in general, but at least
for Windows, where it's known Apache will receive link as UTF-8 and pass
it as is to PHP, we can translate it into correct encoding before
calling system functions. I guess this is couple lines of code for
Windows build.
Reproduce code:
---------------
1. take any .php script and rename it to any name with UTF-8 2 byte+
symbols. I used russian íîâîñòè.php.
2. Configure Apache on Windows to use PHP as module (loadmodule)
3. Try to request this script from browser
Expected result:
----------------
Script won't load with 500 code. However, it runs when it's name has
only ASCII characters.
Actual result:
--------------
[error] [client 127.0.0.1] PHP Fatal error: Unknown: Failed opening
required
'E:/www/test2/\xd0\x9d\xd0\xbe\xd0\xb2\xd0\xbe\xd1\x81\xd1\x82\xd0\xb8.php'
(include_path='.;C:\\php5\\pear') in Unknown on line 0, referer:
http://test2.ru/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=50203&edit=1