php-windows Digest 14 Aug 2013 19:58:50 -0000 Issue 4136

Topics (messages 31117 through 31119):

Re: php can't resolve 8.3 paths to unicode filenames, is that expected ?
        31117 by: Pierre Joye
        31118 by: R. S.

Readfile() + mpg = http status 500, windows server 2012, php 5.5.1
        31119 by: sniukbp sniukbp

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
hi,

On Wed, Aug 14, 2013 at 9:09 AM, R. S. <rs...@live.com> wrote:

> The code is provided in this thread and in my (dismissed)
> bug report.
>
>     <?
>     $FS = new \COM('Scripting.FileSystemObject', null, CP_UTF8);
>     $FS->CreateTextFile("c:\\Ελλάδα.txt");
>     $ShortPath = $FS->GetFile("c:\\Ελλάδα.txt")->ShortPath;
>     echo $ShortPath;
>     $handle = fopen($ShortPath, 'w');
>     ?>
>
> Here the file is created trough COM as it is stated in source code.
> The com object isn't having any problem with translation from utf
> to encoding used with windows file systems.

COM is not PHP: You are calling the FileSystemObject's GetFile via COM
which uses unicode APIs under the hood. Nothing to do with PHP
streams.

>> Also UTF-8 (or the likes) paths for IO operation has nothing to very
>> little to do with Unicode support as described or tried in the never
>> released PHP 6. It is "only" about using another set of the Windows
>> file APIs, in very short, about using the <funcname>W ones instead of
>> the <funcname>A (which are aliases to <funcname> when UNICODE define
>> is not set).
>
> So this should be trivial to change in php's source code.

Not really, and not only in PHP code but all dependencies PHP uses.



-- 
Pierre

@pierrejoye | http://www.libgd.org

--- End Message ---
--- Begin Message ---
Hello Pierre,

Wednesday, August 14, 2013, 10:27:24 AM, you wrote:

> COM is not PHP: You are calling the FileSystemObject's GetFile via COM
> which uses unicode APIs under the hood. Nothing to do with PHP
> streams.

Yes, I know that, and here COM has no issues with unicode.

But in my example COM is irrelevant it is used only to get
short path, to be sure that it leads to the unicode file.
You can create unicode file on your own and then try
to open it using short or long paths using any script you like.
And you see that only PHP among all scripting languages in incapable
of getting handle to such files. Even the software that doesn't know
a byte about unicode is capable of doing that but not PHP.

> Not really, and not only in PHP code but all dependencies PHP uses.

I really don't know php's source code so I can't answer that.


--- End Message ---
--- Begin Message ---
Good morning,
I run into same trouble.

Kind regards





hi oli,
i can confirm this if i use following command.
one download one 500

[download.cmd]
"C:\Program Files (x86)\GnuWin32\bin\wget.exe" --limit-rate=40000
http://127.0.0.1/index.php

did you find any solution?

regards


Hi List,
i installed a blank Windows Server 2012 Standard, added Role IIS & Feature
CGI
extracted 5.5.1 VC11 x86 Non Thread Safe to c:\Program Files (x86)\php
installed vcredist_x86.exe

added Handler Mappings in IIS
Request path: *.php
Module: FastCgiModule
Executable: c:\Program Files (x86)\php\php-cgi.exe
Name: PHP via FastCgi

Added 2 files to C:\inetpub\wwwroot index.php & movie.mpg (6MB)
Content of index.php

<?php
$track = "movie.mpg";
if (file_exists($track)) {
    header("Content-Type: audio/mpeg");
    header('Content-Length: ' . filesize($track));
    header('Content-Disposition: inline; filename="movie.mpg"');
    header('X-Pad: avoid browser bug');
    header('Cache-Control: no-cache');
    readfile($track);
    exit;
} else {
    header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
    echo "no file";
}

?>

Now every time the index.php is requested i get an error 500 in
Webserver log. But file will be delivered sucessfully.
Is there a problem with mpg files and readfile();
No difference with 5.4.17, 5.3.27 & Windows Server 2008 R2.
I know its very basic, but expected result should be: HTTP-Status: 200 or?
phpinfo() will be delivered succesful.

Thx + regards
oli

--- End Message ---

Reply via email to