无法访问拷贝到在/ var / WWW /或其他文件夹PHP文件 [英] Can't access php files copied into /var/www/ or other folders

查看:166
本文介绍了无法访问拷贝到在/ var / WWW /或其他文件夹PHP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu 12.10与LAMP设置。我复制已经从XAMPP / htdocs中的项目文件(PHP,HTML,CSS)我的Windows PC上到我的ubuntu的/ var / WWW /子目录。然而,当我从浏览器访问这些文件(我可以看到列出的目录),我得到403禁止在该目录中的所有文件。
所以我创建该目录中的新的虚拟的PHP文件只为了看看我是否能访问,和它的作品。所有的想法可能是什么问题?

I'm on Ubuntu 12.10 with LAMP setup. I copied a subdirectory which has project files (php, html, css) from xampp/htdocs on my Windows PC into /var/www/ of my ubuntu. However, when I access those files from browser (I can see the directory listing), I get 403 Forbidden on all files within that directory. So I create new dummy php files within that directory just to see if I can access, and it works. Any idea what might be the problem?

推荐答案

可能是一个所有权的问题。
尝试做
搭配chmod -R 775 /无功/网络/文件夹
和/或
CHOWN -R域名:www数据的/ var / WWW /文件夹 - 其中域是特定的虚拟主机或WWW的数据的用户

may be a ownership problem. try do chmod -R 775 /var/www/folder and/or chown -R domain:www-data /var/www/folder - where domain is the user of that particular virtualhost or www-data

有关目录列表,你可能需要修改在/ etc / apache2的/网站的可用/默认

for directory listing you may want to modify in /etc/apache2/sites-available/default

+指数

看<一个href=\"http://www.cyberciti.biz/faq/enabling-apache-file-directory-indexing/\">http://www.cyberciti.biz/faq/enabling-apache-file-directory-indexing/

这篇关于无法访问拷贝到在/ var / WWW /或其他文件夹PHP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆