简体   繁体   English

www目录中的PHP文件无法访问用户目录中的图像

[英]PHP file in www dir can't access images in user dir

I have a PHP file in my var/www directory and I want it to read images from the /user/folder/folder directory. 我的var / www目录中有一个PHP文件,我希望它从/ user / folder / folder目录中读取图像。 I have tried creating a soft link to the user folder, however, nothing seems to be working. 我尝试创建到用户文件夹的软链接,但是,似乎没有任何作用。 Any help would be greatly appreciated. 任何帮助将不胜感激。 To note, my permissions for dir and all files is set to 755 and the user and group are set to my username (pass required for access). 请注意,我对dir和所有文件的权限设置为755,并且用户和组设置为我的用户名(访问需要通过)。

 $files = glob("~user/downloads/other/*.*"); 

Seems to work fine when you include the full file path. 当您包含完整的文件路径时,似乎工作正常。 Not sure what OS you're on, but should be similar to glob("/Users/yourusername/downloads/*.*"); 不确定您使用的是哪种操作系统,但应该类似于glob("/Users/yourusername/downloads/*.*");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM