CakePp在Ubuntu 14.04中不工作

编程入门 行业动态 更新时间:2024-10-27 22:19:33
本文介绍了CakePp在Ubuntu 14.04中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经安装cakephp v2.4.6在Ubuntu 14.04(64位)和数据库是PostgreSQL。同样的系统在Windows环境下工作正常,但是在我将它转移到Ubuntu后,它显示一些问题。

  • CSS不工作。
  • 登录后,系统显示错误消息未在服务器中找到请求的网址。 >

    某些论坛要求我们更改 /etc/apache2/sites-available/default.conf 中的配置文件。但我找不到任何 default.conf 文件。

    请指导。谢谢。

    解决方案

    很可能是htaccess / mod_rewrite的问题。

    如果您访问 example/app/webroot/css,您可以看到css /my_file.css ?

    启用mod_rewrite: sudo a2enmod rewrite

    / etc / apache2 / sites-available / 。它可能是 default.conf 或 000-default.conf ,或者它可能在您的站点后命名。

    您需要确保该文件中存在以下选项(注意:注意 - 您的目录可能略有不同 - 例如 / var / www / html 或其他,如果不同,请不要更改):

    < Directory / var / www /> 选项索引FollowSymLinks MultiViews AllowOverride所有订单允许,拒绝允许所有< / Directory>

    最后,重新启动apache: sudo service apache2 restart

    有关详细信息,请参阅此文章: www.digitalocean/community/tutorials/how-to-set-up-mod_rewrite

    I have installed cakephp v2.4.6 in Ubuntu 14.04 (64 bit) and database is PostgreSQL. The same system works fine in Windows environment but after I transfer it into Ubuntu, it shows some issues.

  • The CSS does not work. No color and the login screen alignment change.
  • After login, an error says "the requested url was not found in the server" came.
  • Some forum ask us to change the config file in /etc/apache2/sites-available/default.conf. But I could not find any default.conf file.

    Please guide. Thank you.

    解决方案

    Most likely, it's an issue with htaccess / mod_rewrite.

    Can you see the css if you go to example/app/webroot/css/my_file.css? If so, it's a mod_rewrite issue.

    Here's some stuff to try:

    Enable mod_rewrite: sudo a2enmod rewrite

    There will be some relevant file in /etc/apache2/sites-available/. It might be default.conf, or 000-default.conf or it might be named after your site. But there should be some relevant file there, and you'll need to edit it.

    You'll need to ensure the following options are present in that file (note: be careful - your Directory may be slightly different - eg /var/www/html or something else. If it differs, don't change it):

    <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>

    Lastly, restart apache: sudo service apache2 restart

    See this article for more detail: www.digitalocean/community/tutorials/how-to-set-up-mod_rewrite

    更多推荐

    CakePp在Ubuntu 14.04中不工作

    本文发布于:2023-06-03 08:56:57,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/470187.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:中不   工作   CakePp   Ubuntu

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!