已解决 修改config目录中的config.php 中webRoot参数无效

修改参数$config->webRoot      = '/zentao';

没有效果。最新版本9.1.1

很多js和css没加载下来。

禅道版本 9.1.1 源码包
操作系统
客户端浏览器

提问者: 心是蓝色 悬赏:5 日期: 2017-04-10 15:37:05 答案:2 点击:4103

获取技术支持

QQ: 电话:
备注

其他参数例如 设置 $config->version      = '9.1.x1';  有效。就是设置 webRoot无效。我要安装到虚拟目录下。

 
设置备注
答案列表
2017/04/10
填写 $config->webRoot         = getWebRoot(); 然后试试。
2017/04/11
还是不行。。。不知道啥情况。我的环境是 ubuntu16 nginx+php7

nginx里面主要配置:
location ~ ^/zentao/.+\.php$ {
root /opt/zentao/www/;
rewrite /zentao/(.*\.php?) /$1 break;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME /opt/zentao/www/$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/zentao($|/.*) {
alias /opt/zentao/www/$1;
index index.php index.html index.htm;
}
2017/04/12

nginx配置参考下:

    location / {
        root   /var/www/zentaopms/www;
        try_files $uri $uri/ /index.php?$args;
        index  index.php index.html;
    }

    location ~ \.php$ {
        root           /var/www/zentaopms/www;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO $request_uri;
        include        fastcgi_params;
    }


2017/04/13
谢谢你的回复。你这样是配置到了根路径下面,我想加一个虚拟路径例如
location /zentao {
xxxxxxxxx其他内容
}。可是没有效果
2017/04/13
location ~ ^/zentao/.+\.php$ {
root /opt/zentao/www;
#rewrite /zentao/(.*\.php?) /$1 break;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;

if ( $fastcgi_script_name ~ ^/zentao/(.*\.php) ) {
set $cginame $1;
}
fastcgi_param SCRIPT_FILENAME $document_root/$cginame;
include fastcgi_params;
}
location ~ ^/zentao($|/.*) {
alias /opt/zentao/www/$1;
index index.php index.html index.htm;
}
这样就好了