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条)

报告相同问题?

悬赏问题

  • ¥15 MATLAB动图的问题
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名