|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28279 function symlink() crash under windows
Submitted: 2004-05-05 05:30 UTC Modified: 2018-03-11 17:02 UTC
From: motion4u at hotmail dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: 4.3.6 OS: Windows 2000 Advanced
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: motion4u at hotmail dot com
New email:
PHP Version: OS:


 [2004-05-05 05:30 UTC] motion4u at hotmail dot com
Create and Manipulate NTFS Junction Points doesn't work in PHP but it was solved by They also offer the c-code free for download.

I have tested it and it works very well.

You can download the free source code there:

Reproduce code:
$letters = 'abcdefghijklmnopqrstuvwxyz'; 
srand((double) microtime() * 1000000); 
$string = ''; 
for ($i = 1; $i <= rand(4,12); $i++) { 
   $q = rand(1,24); 
   $string = $string . $letters[$q]; 
//----- this part can't work under windows
$handle = opendir($downloaddir); 
while ($dir = readdir($handle)) { 
   if (is_dir($downloaddir . $dir)){ 
     if ($dir != "." && $dir != ".."){ 
         @unlink($downloaddir . $dir . "/" . $filename); 
         @rmdir($downloaddir . $dir); 
     } } } 
closedir($handle); //------
mkdir($downloaddir . $string, 0777); 
// here symlink produce browser crash under windows
symlink($safedir . $filename, $downloaddir . $string . "/" . $filename); 
Header("Location: ".$downloadURL.$string. "/" . $filename);

Expected result:
start downloading but produce browser crash


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-05 11:17 UTC]
Windows versions of PHP don't even have symlink(), readlink(), linkinfo() or link(), so it can't possibly be crashing.

I'll accept your feature request for NTFS junctions, but can't do anything about it until we are developing PHP 5.1.
 [2018-03-11 17:02 UTC]
-Status: Suspended +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2018-03-11 17:02 UTC]
symlink(), readlink(), linkinfo() and link() are available on
Windows as of PHP 5.3.0.
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC