在本地进行开发,现在可以传输服务器上的所有内容。它工作正常,但调试工具无法正确显示。
我无法访问js,css等。因此,我只看到一个空盒子,上面没有未装载的蛋糕图片。数据写在数据库中(我正在使用标准连接,只是插入了面板和请求表。
因此,我的猜测是所有原因。或者我的应用程序安装在子目录/子目录中。
bootstrap.php
if (Configure::read('debug')) {
Plugin::load('DebugKit', ['bootstrap' => true]);
}
app.php '调试'=> 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'],
]
它尝试处理的链接是:https : //www.example.com/sub/sub2/debug_kit/webroot/css/reset.css
蛋糕位于sub2文件夹中
来自webroot的htaccess
<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>
来自sub2的htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
好的,我现在知道了,这是愚蠢的错误-但我仍然想知道为什么它可以在我的其他系统上运行:/
RewriteBase /sub/sub2
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
在我前面有一个斜线之前 webroot/
感谢@ AD7six的支持。我很感激。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句