PHP符号链接没有创建


php symlinks not creating

我正在尝试创建一个符号链接与目标目录外我的脚本根和链接内的文件夹在我的脚本:

if(!file_exists('properties')) {
        symlink('/hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties' , __DIR__.'/properties');
var_dump( file_exists('/hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties'));
var_dump( is_dir('/hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties'));
    }

两个var_dumps都返回true。没有这样的文件或目录。我哪里做错了

您很可能有权限错误。试试shell命令

ln -s /hermes/bosnaweb03a/b1456/nf.comcan/public_html/properties , {PHP_SCRIPT_LOCATION}/properties'

使用相同的用户运行脚本。如果这不能创建文件,那么您需要以具有创建文件权限的用户身份运行,或者您可以将位置上的权限更改为更大的权限。