PHP symlink () error on Windows 7

PHP's symlink () function does not work on Windows 7 with an error:

Warning: symlink(): Cannot create symlink, error code(3) in C:\xampp\htdocs\…\lib\model\doctrine\Website.class.php 

This is a XAMPP server with PHP 5.3.8.

From the symlink () documentation:

5.3.0 This feature is now available on Windows platforms (Vista, Server 2008 and higher).

Any ideas / suggestions?

+2
php windows-7 symlink
source share
3 answers

There might be a bug in PHP 5.3 according to this:

https://bugs.php.net/bug.php?id=48975

and this:

http://forum.wampserver.com/read.php?2,64011 (answer # 2)

Perhaps you could upgrade to PHP 5.4 and see if it works?

+3
source share

I use this

 //symlink($target, $link); exec('mklink /j "' . str_replace('/', '\\', $link) . '" "' . str_replace('/', '\\', $target) . '"'); 
0
source share

About PHP CLI on Windows:
Remember to start the console using Run as Administrator else symlink will return false and cause the following error:

 Warning: symlink(): Cannot create symlink, error code(1314) 
0
source share

All Articles