Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined variable: controlIPs #41

Open
gagarine opened this issue Jun 13, 2012 · 3 comments
Open

Undefined variable: controlIPs #41

gagarine opened this issue Jun 13, 2012 · 3 comments

Comments

@gagarine
Copy link

Sometimes I get a blank page with:

Notice: Undefined variable: controlIPs in /Users/simon/Sites-src/xhprof/xhprof_html/index.php on line 9
Call Stack: 0.0002 641592 1. {main}() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:0Notice: Undefined variable: controlIPs in /Users/simon/Sites-src/xhprof/xhprof_html/index.php on line 9
Call Stack: 0.0002 641592 1. {main}() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:0 Warning: in_array() expects parameter 2 to be array, null given in /Users/simon/Sites-src/xhprof/xhprof_html/index.php on line 9
Call Stack: 0.0002 641592 1. {main}() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:0 0.0006 724160 2. in_array() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:9 You do not have permission to view this page.

I use nginx with php-fpm. If I refresh the page the error go away but come back the next refresh (toggle). I have to restart php-fpm and nothing go wrong until I profile the website again... Profile will be recorded normally.

@gagarine
Copy link
Author

Right after the restart I get this one on top (but the XH GUI page load)...

Strict standards: Static function Db_Abstract::getNextAssoc() should not be abstract in /Users/simon/Sites-src/xhprof/xhprof_lib/utils/Db/Abstract.php on line 14

Call Stack:
    0.0018     727664   1. {main}() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:0
    0.0157    1806200   2. XHProfRuns_Default->__construct() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:50
    0.0157    1806248   3. XHProfRuns_Default->db() /Users/simon/Sites-src/xhprof/xhprof_lib/utils/xhprof_runs.php:84
    0.0159    1836600   4. require_once('/Users/simon/Sites-src/xhprof/xhprof_lib/utils/Db/Pdo.php') /Users/simon/Sites-src/xhprof/xhprof_lib/utils/xhprof_runs.php:90


Strict standards: Static function Db_Abstract::unixTimestamp() should not be abstract in /Users/simon/Sites-src/xhprof/xhprof_lib/utils/Db/Abstract.php on line 17

Call Stack:
    0.0018     727664   1. {main}() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:0
    0.0157    1806200   2. XHProfRuns_Default->__construct() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:50
    0.0157    1806248   3. XHProfRuns_Default->db() /Users/simon/Sites-src/xhprof/xhprof_lib/utils/xhprof_runs.php:84
    0.0159    1836600   4. require_once('/Users/simon/Sites-src/xhprof/xhprof_lib/utils/Db/Pdo.php') /Users/simon/Sites-src/xhprof/xhprof_lib/utils/xhprof_runs.php:90


Strict standards: Static function Db_Abstract::dateSub() should not be abstract in /Users/simon/Sites-src/xhprof/xhprof_lib/utils/Db/Abstract.php on line 18

Call Stack:
    0.0018     727664   1. {main}() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:0
    0.0157    1806200   2. XHProfRuns_Default->__construct() /Users/simon/Sites-src/xhprof/xhprof_html/index.php:50
    0.0157    1806248   3. XHProfRuns_Default->db() /Users/simon/Sites-src/xhprof/xhprof_lib/utils/xhprof_runs.php:84
    0.0159    1836600   4. require_once('/Users/simon/Sites-src/xhprof/xhprof_lib/utils/Db/Pdo.php') /Users/simon/Sites-src/xhprof/xhprof_lib/utils/xhprof_runs.php:90

@bertrandmalet
Copy link

Hi,

The strict standars issue is corrected in pull #44

@stubbetje
Copy link

note: I'm not a php-fpm user

Reason of the undefined variable: controlIPs error is that the config.php is included in the index.php by using require_once, so the file could already by included. In that case, the vars defined in config.php will not be defined in the scope of index.php.

So either make sure that config.php is not already loaded ( do you by any chance auto_prepend_file "external/header.php" on the xhprof gui? ), or change the require_once of config.php to include.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants