CakePHP 没有 mod_rewrite 问题
我已经使用 CakePHP 开发了一个网站,现在尝试将其托管在实时服务器上。我无法从托管服务获得太多帮助,但我认为他们不允许 mod_rewrite (每当我尝试打开它时,我都会收到 500 服务器错误)。
因此,我研究了在不使用 mod_rewrite 的情况下使用 CakePHP。现在我至少可以看到该网站,但我收到了大量错误,特别是:
- 找不到 css 和 js 文件。
- 数据库似乎有问题,虽然可能与上面的问题有关,但我不能确定。
实时网站可以在 new.enviro.lu 上查看。
可以在 enviro.webforall.be 看到工作网站。
有人能给我指出解决这些问题的正确方向吗?
我正在使用 CakePHP 1.3.4。
I've developed a website using CakePHP and I am now trying to host it on the live server. I couln't get much help from the hosting service, but I think they do not allow mod_rewrite (I get 500 server error whenever I try to turn it on).
So, I looked into using CakePHP without mod_rewrite. Now I can at least see the website, but I'm getting tons of errors, in particular:
- The css and js files are not found.
- There seems to be problems with the database, although it might be related to the problem above, I can't tell for sure.
The live website can be seen at new.enviro.lu.
The working website can be seen at enviro.webforall.be
Can anybody point me into the right direction to solve these problems?
I'm using CakePHP 1.3.4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CSS 和 JavaScript 页面未显示的问题是 Apache 的 DocumentRoot 指向错误的目录。 DocumentRoot 应该是 /app/webroot,但您已将其设置为Cake的根目录。如果您访问 http://new.enviro.lu/app/webroot/,您可以看到路径有效。
页面上的数据库错误为:
这表明
content_pages
表尚未按照错误消息所述创建,或者数据库配置指向错误的数据库。The problem with the CSS and JavaScript pages not showing is that you have Apache's DocumentRoot point to the wrong directory. The DocumentRoot should be /app/webroot, but you have it set to Cake's root directory. You can see that the paths work if you access http://new.enviro.lu/app/webroot/.
The database error on the page is:
This suggests that either the
content_pages
table has not been created as the error message says or the database configuration points at a wrong database.尝试联系您的托管提供商并要求他们为您的帐户开启 mod_rewrite,或者询问他们如何做到这一点。没有它,CakePhp 将无法工作。
Try contacting your hosting provider and ask them to turn mod_rewrite on for your account, or ask them how you can do it. CakePhp will not work without it.