I'm not able to run a PHP enabled web site under Apache on Windows XP if the path to DOCUMENT_ROOT contains accented letters. I'm not referring to the script file names themselves but to any folder in the path components.
I have this virtual host definition:
<VirtualHost *:80>
ServerName foo.local
DocumentRoot "E:/gonzález/sites/foo"
ErrorLog logs/foo.local-error.log
CustomLog logs/foo.local-access.log combined
<Directory "E:/gonzález/sites/foo">
AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
- If I save the file in ANSI (Windows-1252) I get a syntax error: DocumentRoot must be a directory
- If I save the file in Unicode (UTF-16) I get another syntax error: Invalid command '\xff\xfe#', perhaps misspelled or defined by a module not included in the server configuration (looks like it's complaining about the BOM)
- If I save the file in BOM-less UTF-8 Apache works fine and it serves static files with no apparent issue...
... however, PHP complaints when loading any *.php file (even an empty one):
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'E:/gonzález/sites/foo/vacio.php' (include_path='.;C:\Archivos de programa\PHP\pear') in Unknown on line 0
I decided to try the 8+3 short name of the directory (just a test, I don't want to use such a workaround):
<VirtualHost *:80>
ServerName foo.local
DocumentRoot "E:/GONZLE~1/sites/foo"
ErrorLog logs/foo.local-error.log
CustomLog logs/foo.local-access.log combined
<Directory "E:/GONZLE~1/sites/foo">
AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
But I get the same behaviour:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'E:/gonzález/sites/foo/vacio.php' (include_path='.;C:\Archivos de programa\PHP\pear') in Unknown on line 0
While there're obvious workarounds (use plain ASCII in all directory names or create NTFS junctions to hide actual names) I can't believe that this cannot be done. Do you have more information about the subject?
My specs include 32 bit Windows XP Professional SP3, Apache/2.2.13 and PHP/5.2.11 running as Apache module (but I've noticed the same issue in another box with Windows Vista and PHP/5.3.1).
Update
I'm using NTFS and the Windows codepage is Win-1252 (it's a Spanish lang version of Windows). Perhaps it's relevant :-?
Update #2
I remark that I'm not having problems with PHP includes or requires, include_path or any other PHP piece of code. My problem is that the PHP interpreter will not find the PHP script itself, even if it's a static HTML document with *.php extension.
Update #3
Upon further reading, it appears the PHP does not use the double-byte functions provided by the Windows API. Unless I got it wrong, this seems to prove that what I want to do is just not possible.