[英]Shows the Apache directory structure instead of my app
I am working on my first CakePHP project, and I have done the following: 我正在做我的第一个CakePHP项目,并且已经完成了以下工作:
And when I go http://localhost
it shows the correct Apache welcome page for Centos. 当我进入
http://localhost
它将显示Centos的正确Apache欢迎页面。 But when I go to http://localhost/sampleapp
it shows me the directory structure 但是当我转到
http://localhost/sampleapp
它显示了目录结构
http://localhost/sampleapp
Parent Directory -
app/ 05-Jan-2013 14:20 -
build.properties 05-Jan-2013 14:20 177
build.xml 05-Jan-2013 14:20 8.6K
html/ 05-Jan-2013 14:20 -
index.php 05-Jan-2013 14:20 1.4K
lib/ 05-Jan-2013 14:20 -
plugins/ 05-Jan-2013 14:20 -
vendors/ 05-Jan-2013 14:20
What am I missing here? 我在这里想念什么? I have checked that the .htaccess file is also there
我检查了.htaccess文件是否也在那里
With some SO research I added the following line to /etc/httpd/conf/httpd.conf
通过一些SO研究,我
/etc/httpd/conf/httpd.conf
下行添加到/etc/httpd/conf/httpd.conf
AddType application/x-httpd-php .php
and restart the Apache but it didn't work. 并重新启动Apache,但没有成功。
I'm using 我正在使用
First of all you should disable the Indexes of Apache. 首先,您应该禁用Apache的索引。
After that make sure php is loaded by Apache. 之后,确保php由Apache加载。
httpd -l
and httpd -M
and search for 'php' or similar. httpd -l
和httpd -M
并搜索“ php”或类似名称。
I am not sure about cake-php but in symfony2 the document-root is /root-to-page/web
我不确定cake-php,但在symfony2中,文档根目录为
/root-to-page/web
And if cake-php uses .htaccess
files you must change AllowOverride None
to AllowOverride All
in your vHost or Server settings 而且,如果cake-php使用
.htaccess
文件,则必须在vHost或Server设置中将AllowOverride None
更改为AllowOverride All
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.