cakePHP没有域名 [英] cakePHP without domain name

查看:184
本文介绍了cakePHP没有域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用nginx,php,mysql环境设置了我的Raspberry Pi 2,并用composer安装了cakePHP。



现在cakePHP登陆页面看起来很奇怪。我假设这个问题与我的nginx vhost配置有关。 (conf with vhost works,CSS files loading)



问题是:是否可以使用没有vhost conf的蛋糕?



路由设置为相应的文件夹:



$ routes-> connect('/ test /',['controller'=>'Pages' 'action'=>'display','home']);



请谨慎对待,


解决方案

通过将这些行添加到我的/ etc / nginx / sites-enabled /默认配置文件中来解决问题: p>

  location / test / {
alias / usr / share / nginx / www / test / webroot /;
}


I've set up my Raspberry Pi 2 with a nginx, php, mysql environment and installed cakePHP with composer.

Now the cakePHP landing page looks weird. I'm assuming that this issue is related to my nginx vhost configuration. (Conf with vhost works, CSS files loading)

The question is: is it possible to use cake without vhost conf?

The route is set to the respective folder:

$routes->connect('/test/', ['controller' => 'Pages', 'action' => 'display', 'home']);

With best regards,

Phil

解决方案

Solved the problem by adding these lines into my /etc/nginx/sites-enabled/default conf-file:

location /test/ {
        alias /usr/share/nginx/www/test/webroot/;
}

这篇关于cakePHP没有域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆