Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Centos中的符号链接_Php_Apache_Centos - Fatal编程技术网

Php Centos中的符号链接

Php Centos中的符号链接,php,apache,centos,Php,Apache,Centos,我有目录: /var/www/site1/images/*.jpg 及 所以,我想要从site1到site2的符号链接图像。 我运行: 没关系。如果我检查功能: 文件\u存在(site2/images/example.jpg)可以,但如果我想: <img src="site2/images/examples.jpg" /> 结果:403禁止您正在为文件夹创建硬链接,这不起作用。 尝试使用“-s”选项,这将创建一个符号链接。大多数文件系统都不允许指向目录的硬链接,因此您可能需要

我有目录:

/var/www/site1/images/*.jpg

所以,我想要从site1到site2的符号链接图像。 我运行:

没关系。如果我检查功能:
文件\u存在(site2/images/example.jpg)
可以,但如果我想:

<img src="site2/images/examples.jpg" />


结果:403禁止

您正在为文件夹创建硬链接,这不起作用。
尝试使用“-s”选项,这将创建一个符号链接。

大多数文件系统都不允许指向目录的硬链接,因此您可能需要 创建符号链接

默认情况下,ln命令创建硬链接。创建 符号链接,将-s或--symbol选项传递给命令

ln -s /source /link

这不是一个真正的PHP问题。但请点击此处查看答案:
<img src="site2/images/examples.jpg" />
ln -s /source /link