|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-03-24 22:43 UTC] lukemoynihan at gmail dot com
Description:
------------
PHP does not resolve symlinks (On Vista) or Junctions (windows 2000)
on windows when including files
Create index.php and test.php as shown below, then create a symlink
on Vista using:
mklink test2.php test.php
Note: this test case illustrates symlinks, but that Junctions created
on NTFS volumes also have this problem.
Reproduce code:
---------------
index.php:
<?php
include_once('test.php');
include_once('test2.php');
include_once('test2.php');
test.php:
<?php
echo "i'm included ";
Expected result:
----------------
Expected on Linux:
i'm included
Expected on Windows:
i'm included
Actual result:
--------------
Actual on Linux:
i'm included
Actual on Windows:
i'm included i'm included
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 22:00:02 2025 UTC |
I've just checked the snapshot PHP 5.3 (5.3.0RC4-dev) VC6 x86 Non Thread Safe (2009-Jun-17 13:00:00) (Zip, sha1: 269d823708ed9bec3cd4ab5ca563245ed6aed820) and neither symlink nor junction is working for me. My scenario is a bit different, i'm linking not a file but a directory: D:\dev\lib is the target. D:\dev\link is the symlink/junction. When i try to include the file D:\dev\link\test.php i get the following error: ------------ Warning: include_once(D:\dev\link\test.php) [function.include-once]: failed to open stream: No such file or directory in D:\dev\test-47767.php on line 2 Fatal error: include_once() [function.include]: Failed opening required 'D:\dev\link\test.php' (include_path='.') in D:\dev\test-47767.php on line 2 ------------ is_file('D:\dev\link\test.php') returns true and an include to D:\dev\lib\test.php is working correctly.