我已经安装cakephp v2.4.6在Ubuntu 14.04(64位)和数据库是PostgreSQL。同样的系统在Windows环境下工作正常,但是在我将它转移到Ubuntu后,它显示一些问题。
某些论坛要求我们更改 /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.
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中不工作
发布评论