Php 使用XHProf和XHGui时出错

Php 使用XHProf和XHGui时出错,php,osx-mountain-lion,zlib,xhprof,Php,Osx Mountain Lion,Zlib,Xhprof,我已按照以下说明安装并配置了XHGui: 但是,当我尝试分析页面时,我看到一个错误插入到details表中(由于存在大量二进制/压缩数据,因此已将其截断): 我相信正在使用zlib压缩,我的PHP安装是使用zlib支持编译的: './configure' '--prefix=/usr/local/php5' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-open

我已按照以下说明安装并配置了XHGui:

但是,当我尝试分析页面时,我看到一个错误插入到details表中(由于存在大量二进制/压缩数据,因此已将其截断):

我相信正在使用zlib压缩,我的PHP安装是使用zlib支持编译的:

'./configure' '--prefix=/usr/local/php5' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-gd' '--with-ldap' '--with-xmlrpc' '--enable-exif' '--enable-soap' '--enable-sqlite-utf8' '--enable-wddx' '--enable-ftp' '--enable-sockets' '--with-bz2=/usr' '--enable-zip' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-mbstring' '--enable-bcmath' '--enable-calendar' '--with-iodbc' '--with-mhash' '--enable-fpm' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--enable-dtrace' '--with-icu-dir=/usr/local/php5' '--with-mssql=shared,/usr/local/php5' '--with-pdo-dblib=shared,/usr/local/php5' '--with-libxml-dir=shared,/usr/local/php5' '--with-xsl=shared,/usr/local/php5' '--with-imap=../imap-2007f' '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--with-gettext=/usr/local/php5' '--with-curl=shared,/usr/local/php5' '--with-png-dir=/usr/local/php5' '--with-jpeg-dir=/usr/local/php5' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local/php5' '--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/local/php5' '--with-tidy=/usr/local/php5' '--with-gmp=shared,/usr/local/php5' '--with-readline=shared,/usr/local/php5'
有人以前见过这个或者知道发生了什么吗?它在localhost(mountainlion)上运行,带有-php5.4

更新

我增加了服务器id字段长度并再次运行配置文件。现在获得:

由于此查询,第1行的列“pmu”的整数值“”不正确:

INSERT INTO `details` (`id`, `url`, `c_url`, `timestamp`, `server name`, `perfdata`, `type`, `cookie`, `post`, `get`, `pmu`, `wt`, `cpu`, `server_id`, `aggregateCalls_include`) VALUES('5279085839571', '/whats-on/?', '/whats-on/?', FROM_UNIXTIME('1383663629'), 'local.mysitename', 'x^��\0\0�\0�', '1', 'a:1:{s:8:\"_profile\";s:1:\"1\";}', 'a:0:{}', 'a:0:{}', '', '', '', 'localhost', '') 
显示创建表:

CREATE TABLE `details` (
  `id` char(17) NOT NULL,
  `url` varchar(255) DEFAULT NULL,
  `c_url` varchar(255) DEFAULT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `server name` varchar(64) DEFAULT NULL,
  `perfdata` mediumblob,
  `type` tinyint(4) DEFAULT NULL,
  `cookie` blob,
  `post` blob,
  `get` blob,
  `pmu` int(11) unsigned DEFAULT NULL,
  `wt` int(11) unsigned DEFAULT NULL,
  `cpu` int(11) unsigned DEFAULT NULL,
  `server_id` char(3) NOT NULL DEFAULT 't11',
  `aggregateCalls_include` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `url` (`url`),
  KEY `c_url` (`c_url`),
  KEY `cpu` (`cpu`),
  KEY `wt` (`wt`),
  KEY `pmu` (`pmu`),
  KEY `timestamp` (`timestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
有几个问题:

  • PDO使用什么数据库后端?MySQL?其他?如果是MySQL,请尝试MySQL(i)适配器?数据存储在MySQL
  • 如果复制/粘贴查询(为了简单起见,省略blob数据),查询是否会执行,或者甚至会得到更详细的错误?它是否正常工作
  • 您正在使用的后端是否很好地支持blob?MySQL
  • 您是否可以为您的详细信息表显示
    show CREATE TABLE
我不认为压缩是个问题,它会在更早的时候失败,就像这里:

通过更新后的
SHOW CREATE TABLE
和查询,我得到:

Database changed
mysql> CREATE TABLE `details` (
    ->   `id` char(17) NOT NULL,
    ->   `url` varchar(255) DEFAULT NULL,
    ->   `c_url` varchar(255) DEFAULT NULL,
    ->   `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    ->   `server name` varchar(64) DEFAULT NULL,
    ->   `perfdata` mediumblob,
    ->   `type` tinyint(4) DEFAULT NULL,
    ->   `cookie` blob,
    ->   `post` blob,
    ->   `get` blob,
    ->   `pmu` int(11) unsigned DEFAULT NULL,
    ->   `wt` int(11) unsigned DEFAULT NULL,
    ->   `cpu` int(11) unsigned DEFAULT NULL,
    ->   `server_id` char(3) NOT NULL DEFAULT 't11',
    ->   `aggregateCalls_include` varchar(255) DEFAULT NULL,
    ->   PRIMARY KEY (`id`),
    ->   KEY `url` (`url`),
    ->   KEY `c_url` (`c_url`),
    ->   KEY `cpu` (`cpu`),
    ->   KEY `wt` (`wt`),
    ->   KEY `pmu` (`pmu`),
    ->   KEY `timestamp` (`timestamp`)
    -> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO `details` (`id`, `url`, `c_url`, `timestamp`, `server name`, `perfdata`, `type`, `cookie`, `post`, `get`, `pmu`, `wt`, `cpu`, `server_id`, `aggregateCalls_include`) VALUES('5279085839571', '/whats-on/?', '/whats-on/?', FROM_UNIXTIME('1383663629'), 'local.mysitename', 'x^��\0\0�\0�', '1', 'a:1:{s:8:\"_profile\";s:1:\"1\";}', 'a:0:{}', 'a:0:{}', '', '', '', 'localhost', '') ;
Query OK, 1 row affected, 4 warnings (0.00 sec)
有几个问题:

  • PDO使用什么数据库后端?MySQL?其他?如果是MySQL,请尝试MySQL(i)适配器?数据存储在MySQL
  • 如果复制/粘贴查询(为了简单起见,省略blob数据),查询是否会执行,或者甚至会得到更详细的错误?它是否正常工作
  • 您正在使用的后端是否很好地支持blob?MySQL
  • 您是否可以为您的详细信息表显示
    show CREATE TABLE
我不认为压缩是个问题,它会在更早的时候失败,就像这里:

通过更新后的
SHOW CREATE TABLE
和查询,我得到:

Database changed
mysql> CREATE TABLE `details` (
    ->   `id` char(17) NOT NULL,
    ->   `url` varchar(255) DEFAULT NULL,
    ->   `c_url` varchar(255) DEFAULT NULL,
    ->   `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    ->   `server name` varchar(64) DEFAULT NULL,
    ->   `perfdata` mediumblob,
    ->   `type` tinyint(4) DEFAULT NULL,
    ->   `cookie` blob,
    ->   `post` blob,
    ->   `get` blob,
    ->   `pmu` int(11) unsigned DEFAULT NULL,
    ->   `wt` int(11) unsigned DEFAULT NULL,
    ->   `cpu` int(11) unsigned DEFAULT NULL,
    ->   `server_id` char(3) NOT NULL DEFAULT 't11',
    ->   `aggregateCalls_include` varchar(255) DEFAULT NULL,
    ->   PRIMARY KEY (`id`),
    ->   KEY `url` (`url`),
    ->   KEY `c_url` (`c_url`),
    ->   KEY `cpu` (`cpu`),
    ->   KEY `wt` (`wt`),
    ->   KEY `pmu` (`pmu`),
    ->   KEY `timestamp` (`timestamp`)
    -> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO `details` (`id`, `url`, `c_url`, `timestamp`, `server name`, `perfdata`, `type`, `cookie`, `post`, `get`, `pmu`, `wt`, `cpu`, `server_id`, `aggregateCalls_include`) VALUES('5279085839571', '/whats-on/?', '/whats-on/?', FROM_UNIXTIME('1383663629'), 'local.mysitename', 'x^��\0\0�\0�', '1', 'a:1:{s:8:\"_profile\";s:1:\"1\";}', 'a:0:{}', 'a:0:{}', '', '', '', 'localhost', '') ;
Query OK, 1 row affected, 4 warnings (0.00 sec)

谢谢。它被设置为PDO,但我切换到了mysqli-同样的错误。不确定你所说的“我正在使用的后端”是什么意思?测试中的页面是基于Wordpress的网站的一部分。我在mysql客户端中没有运行大的blob信息-它抱怨我增加了服务器id字段的长度。我已经用剩余的错误更新了这个问题(数据至少现在正在写入表中)谢谢,我添加了一个关于show create table的新问题,alsp,如果直接将查询c/p到MySQL中会发生什么?请参见上文重新直接运行查询您的查询对对对对对我有效,它们在命令行中是否对您无效?谢谢。它被设置为PDO,但我切换到mysqli-相同的错误。不确定“我正在使用的后端”是什么意思测试中的页面是基于Wordpress的网站的一部分。我在mysql客户机中运行时没有使用大blob信息-它抱怨我增加了服务器id字段的长度。我用剩余的错误更新了问题(数据至少现在正在写入表中)谢谢,我添加了一个关于show create table的新问题,alsp,如果您直接将查询c/p到MySQL中会发生什么?请参见上文直接重新运行查询您的查询对对适合我,它们在命令行中是否会失败?