Character encoding PhpMyAdmin源中的不可读字符
我在Ubuntu 12上安装了PMA 4.0.7:Character encoding PhpMyAdmin源中的不可读字符,character-encoding,phpmyadmin,installation,Character Encoding,Phpmyadmin,Installation,我在Ubuntu 12上安装了PMA 4.0.7: wget http://www.sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.0.7/phpMyAdmin-4.0.7-all-languages.tar.bz2 tar -jxf phpMyAdmin-4.0.7-all-languages.tar.bz2 但无法在浏览器中打开,Chrome会显示空白页面。。控制台中出现错误: Uncaught SyntaxError: Un
wget http://www.sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.0.7/phpMyAdmin-4.0.7-all-languages.tar.bz2
tar -jxf phpMyAdmin-4.0.7-all-languages.tar.bz2
但无法在浏览器中打开,Chrome会显示空白页面。。控制台中出现错误:
Uncaught SyntaxError: Unexpected token ILLEGAL get_scripts.js.php:13876
CodeMirror.defineMIME("text/x-mysql", "mysql");
;
� // <- unreadible character goes there
Uncaught SyntaxError:意外标记非法获取脚本。js.php:13876
defineMIME(“text/x-mysql”、“mysql”);
;
� // 我无法在Chrome下重现您的问题。再次尝试下载,可能是.tar.gz文件。我也遇到了这个问题。事实证明,该文件是以HTTP 1.1的形式发送的,在b/c中,它没有内容长度头,以分块编码的形式输出。额外的字符是由于不完整的块造成的。我将get_scripts.js.php文件修改为以下内容,现在可以使用:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Concatenates reveral js files to reduce the number of
* http requests sent to the server
*
* @package PhpMyAdmin
*/
chdir('..');
// Send correct type
header('Content-Type: text/javascript; charset=UTF-8');
// Enable browser cache for 1 hour
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
if (! empty($_GET['scripts']) && is_array($_GET['scripts'])) {
$total_length = 0;
foreach ($_GET['scripts'] as $script) {
// Sanitise filename
$script_name = 'js';
$path = explode("/", $script);
foreach ($path as $index => $filename) {
if (! preg_match("@^\.+$@", $filename)
&& preg_match("@^[\w\.-]+$@", $filename)
) {
// Disallow "." and ".." alone
// Allow alphanumeric, "." and "-" chars only
$script_name .= DIRECTORY_SEPARATOR . $filename;
}
}
// Count file size
if (preg_match("@\.js$@", $script_name) && is_readable($script_name)) {
$total_length += filesize($script_name) + 3;
}
}
header('Content-Length: '.$total_length);
foreach ($_GET['scripts'] as $script) {
// Sanitise filename
$script_name = 'js';
$path = explode("/", $script);
foreach ($path as $index => $filename) {
if (! preg_match("@^\.+$@", $filename)
&& preg_match("@^[\w\.-]+$@", $filename)
) {
// Disallow "." and ".." alone
// Allow alphanumeric, "." and "-" chars only
$script_name .= DIRECTORY_SEPARATOR . $filename;
}
}
// Output file contents
if (preg_match("@\.js$@", $script_name) && is_readable($script_name)) {
readfile($script_name);
echo ";\n\n";
}
}
}
?>
禁用/删除/更正Tidy HTML PHP扩展的设置
我有一个运行CentOS 6.6的VM dev box,在安装和配置x-debug时遇到了这个问题。在安装xdebug扩展时,我看到了整洁的HTML,并认为这是一种使生成的HTML更干净、更易于阅读的好方法
一切都进行得很顺利,直到几天后,当我试图访问phpMyAdmin时,Chrome中出现了一个空白页面和5条意外的令牌错误消息。经过大量的研究、设置调整、重新安装phpMyAdmin,并按照Jeremy Miller的建议尝试添加内容长度标题,我最终决定重置整个服务器配置
首先我恢复了phpMyAdmin配置,然后是Apache配置。不走运。然后我删除了所有的PHP扩展。突然,我收到了一条错误信息,而不是一张空白页!进步!我重新添加了phpMyAdmin所需的扩展名:mbstring.ini、json.ini和mysqli.ini,并显示phpMyAdmin登录名
通过一个艰苦的消除过程,我发现Tidy HTML扩展导致了这个问题,这个过程由于我的Linux技能薄弱而受到阻碍
我希望这能帮助那些不假思索地安装扩展的人。我认为这是针对我的系统错误的,但我仍然试图解决这个问题。你是否尝试禁用所有Chrome扩展?你修改了哪些行?我对get_image.js.php
和get_scripts.js.php
@hbrlovehaku也有同样的问题,自从我发布这篇文章以来,已经有一段时间了,但是我想说的是///Count file size
和标题('Content-Length:'.$total\u Length)后面的3行
@hbrls我当前的文件在过期后只需要这个头头('Content-Length:6435')代码>