The manual says
Note: For Windows only: This function requires PHP to run in an elevated mode or with the UAC disabled.
But on my Windows 8 machine I can run mklink /H
without elevated privileges, so I don't understand why PHP would require this. On the other hand, if I run mklink
without the H to create a symlink, I do require elevated privileges, although this isn't commented on in the PHP docs for symlink().
I don't have a windows PHP installation, so can't test it (and I wonder how this applies for windows 7, vista, or whatever). Are the docs wrong?
You do not need to be running as an administrator in order to create a hard link. However, unlike in UNIX, you do need write access to the target of the link.
I would hazard a guess that the author of the document in question was attempting to create a hard link to a file to which only administrators had write access, and so incorrectly concluded that administrator access was necessary in order to create hard links.