douzhushen_9776 2016-06-27 09:10
浏览 31
已采纳

CakePHP 3 debug_kit带子目录

Developed locally and transfered everything on the Server now. It works fine, but the debugkit is not showing properly.

I can´t access the js,css etc. So I am just seeing an empty box with a not loaded cake picture. The data is written in the database (I am using the standard connection and just inserted the panels and requests tables.

So my guess is this causes all that. Or that my App is installed in a sub/sub directory.

bootstrap.php

if (Configure::read('debug')) {
    Plugin::load('DebugKit', ['bootstrap' => true]);
}

app.php 'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),

'debug_kit' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'XXX-IP',
            //'port' => 'nonstandard_port_number',
            'username' => 'XXXDB',    // Your DB username here
            'password' => 'XXXPW',    // Your DB password here
            'database' => 'scdb',                
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,
            'quoteIdentifiers' => false,
            //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
        ]

The link its trying to process is: https://www.example.com/sub/sub2/debug_kit/webroot/css/reset.css

cake lies in the sub2 folder

htaccess from webroot

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sub/webroot
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

htaccess from sub2

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
  • 写回答

2条回答 默认 最新

  • doulangbizhan5160 2016-06-29 08:26
    关注

    Okay I got it right now, stupid mistake - but I still wonder why it works on my other system :/

        RewriteBase /sub/sub2
        RewriteRule    ^$    webroot/ [L]
        RewriteRule    (.*) webroot/$1 [L]
    

    Before I had a slash infront of the webroot/

    Thanks @AD7six for support. I appreciate it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效