CakePhp does not work in Ubuntu 14.04

风流意气都作罢 提交于 2019-12-25 02:29:01

问题


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.

  1. The CSS does not work. No color and the login screen alignment change.
  2. 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.


回答1:


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

Can you see the css if you go to http://example.com/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: https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite



来源:https://stackoverflow.com/questions/25378673/cakephp-does-not-work-in-ubuntu-14-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!