Closed (duplicate)
Project:
XHProf
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2012 at 05:42 UTC
Updated:
2 Jan 2014 at 19:06 UTC
Jump to comment: Most recent
I got the following errors:
Warning: Invalid argument supplied for foreach() in xhprof_compute_inclusive_times() (line 1670 of /DRUPAL7/sites/all/modules/contrib/XHProf/xhprof.inc).
Warning: Invalid argument supplied for foreach() in xhprof_compute_flat_info() (line 1644 of /DRUPAL7/sites/all/modules/contrib/XHProf/xhprof.inc).
Warning: Invalid argument supplied for foreach() in theme_xhprof_overall_summary() (line 367 of /DRUPAL7/sites/all/modules/contrib/XHProf/xhprof.module).
Comments
Comment #1
erikwebb commentedWould you mind re-trying with the 7.x-1.x-dev version? It may still be a problem, but there has been a lot that has changed since then.
Comment #2
Sinan Erdem commentedI am using the latest dev version, but also getting the same errors when I click on the "XHProf output" link at the bottom of a page.
Comment #3
mgiffordThanks Sinan. I have been really swamped the last couple weeks.
Comment #4
erikwebb commentedComment #5
Sinan Erdem commentedNot related with this module but I ended up using xdebug. Basicly i installed xdebug on my linux server. It produces a grind file for every page request in /tmp directory. Then I downloaded and extracted Webgrind under my site root. when i go to mysite.com/webgrind in a browser, it detects those grind files and shows you a nice summary of executed functions.
Comment #6
Loucou commentedI got the same warning, with drupal 7, using the module xhprof.
I found that the origin of the issue is because Drupal/xhprof cannot write into the output directory of xhprof (php).
Usually this directory is defined by the variable "xhprof.output_dir" from a php.ini file.
I've chmod the directory with full access for all (should be more restrictive certainly).
After that, the module works without messages and reports are produced.
Hope it will help.
Comment #7
erikwebb commented@Loucou - That is also being addressed in #1377792: Runs not saved when xhprof.output_dir set to non-existant directory, so maybe this is a duplicate.
@Sinan Erdem or @mgifford - Does this also fix the warnings for you?
Comment #8
Sinan Erdem commentederikwebb, I dont have an installation currently on any of my websites. I cannot test unfortunately.
Comment #9
Ace Cooper commentedI found a solution for the xhprof.inc errors with my setup (click).
I'm running Drupal 7.18 on nginx 1.3.3 under CentOS 6.2 x64.
I've installed the xhprof via pear and set the xhprof.output_dir to a folder, which I deleted later.
As soon as I restored the folder - the module worked perfectly (click).
So after installing xhprof:
- check your /etc/php.d/xhprof.ini or /etc/php.ini;
- set the
xhprof.output_dircorrectly;- make sure the folder permissions allow your webserver user to write there.
Comment #10
erikwebb commentedSo it does sound like an issue with #1377792: Runs not saved when xhprof.output_dir set to non-existant directory. I'm marking this as a duplicate for now. If anyone else finds a case where these errors pop up, but it's unrelated to the output_dir setting, we can re-open this.