Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

$env is empty

#29

I try to do example01, but it does not do well.
it takes warning message below.


example01 warning:
[1. USER WARNING]

'' request method is unkown or unavailable. in /path/to/lib/limonade.php line 849

Reported by sanemat · September 21st, 2009 @ 11:17 AM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. sanemat
    sanemat

    my environment

    $env['SERVER'] and $env['GET'] are empty array. My expect function env() return enviroments, but this return null.

    I seem that $GLOBALS["SERVER"] is not work well. Is it cause of this problem?
    PHP Bugs: #29176: $GLOBALS['
    REQUEST'], $GLOBALS['ENV'] AND $GLOBALS['SERVER'] are empty
    http://bugs.php.net/bug.php?id=29176

    my environment
    Apache/2.2.3, CentOS/5.2, PHP/5.2.8 limonade/0.4.2

    my setting php.ini
    variables_order = "EGPCS"
    register_globals = Off
    register_long_arrays = Off
    register_argc_argv = Off
    auto_globals_jit = On

    September 21st, 2009 @ 11:18 AM

  2. sanemat
    sanemat

    back trace(my realpath replaced '/path/to')

    Not Implemented

    The requested method '' is not implemented
    Options

    Array
    (

    [root_dir] => /path/to/examples/example01
    [base_path] => 
    [base_uri] => ?
    [limonade_dir] => /path/to/lib/
    [limonade_views_dir] => /path/to/lib/limonade/views/
    [limonade_public_dir] => /path/to/lib/limonade/public/
    [public_dir] => /path/to/examples/example01/public/
    [views_dir] => /path/to/lib/limonade/views/
    [controllers_dir] => /path/to/examples/example01/controllers/
    [lib_dir] => /path/to/examples/example01/lib/
    [error_views_dir] => /path/to/lib/limonade/views/
    [env] => 100
    [debug] => 1
    [session] => Fresh_and_Minty_Limonade_App
    [encoding] => utf-8
    [x-sendfile] => 0
    

    )

    [ ↑ ] Environment

    Array
    (

    [SERVER] => Array
        (
        )
    
    [FILES] => Array
        (
        )
    
    [REQUEST] => Array
        (
        )
    
    [SESSION] => Array
        (
        )
    
    [ENV] => Array
        (
        )
    
    [COOKIE] => Array
        (
            [Fresh_and_Minty_Limonade_App] => pcqpk7j2qskhtjegf589fpkde2
        )
    
    [GET] => Array
        (
        )
    
    [POST] => Array
        (
        )
    
    [PUT] => Array
        (
        )
    
    [DELETE] => Array
        (
        )
    
    [HEAD] => Array
        (
        )
    

    )

    [ ↑ ] Backtrace

    Array
    (

    [0] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 1332
            [function] => include
        )
    
    [1] => Array
        (
            [file] => /path/to/lib/limonade/views/error.html.php
            [line] => 6
            [function] => render
            [args] => Array
                (
                    [0] => _debug.html.php
                    [1] => 
                    [2] => Array
                        (
                            [_lim_err_debug_args] => 
                            [errno] => 501
                            [errstr] => The requested method <code>''</code> is not implemented
                            [errfile] => /path/to/lib/limonade.php
                            [errline] => 399
                            [is_http_error] => 1
                        )
    
                )
    
        )
    
    [2] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 1332
            [args] => Array
                (
                    [0] => /path/to/lib/limonade/views/error.html.php
                )
    
            [function] => include
        )
    
    [3] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 702
            [function] => render
            [args] => Array
                (
                    [0] => error.html.php
                    [1] => 
                    [2] => Array
                        (
                            [errno] => 501
                            [errstr] => The requested method <code>''</code> is not implemented
                            [errfile] => /path/to/lib/limonade.php
                            [errline] => 399
                            [is_http_error] => 1
                        )
    
                )
    
        )
    
    [4] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 707
            [function] => server_error
            [args] => Array
                (
                    [0] => 501
                    [1] => The requested method <code>''</code> is not implemented
                    [2] => /path/to/lib/limonade.php
                    [3] => 399
                )
    
        )
    
    [5] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 641
            [function] => error_server_error_output
            [args] => Array
                (
                    [0] => 501
                    [1] => The requested method <code>''</code> is not implemented
                    [2] => /path/to/lib/limonade.php
                    [3] => 399
                )
    
        )
    
    [6] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 617
            [function] => error_default_handler
            [args] => Array
                (
                    [0] => 501
                    [1] => The requested method <code>''</code> is not implemented
                    [2] => /path/to/lib/limonade.php
                    [3] => 399
                )
    
        )
    
    [7] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 565
            [function] => error_handler_dispatcher
            [args] => Array
                (
                    [0] => 501
                    [1] => The requested method <code>''</code> is not implemented
                    [2] => 
                    [3] => 
                )
    
        )
    
    [8] => Array
        (
            [file] => /path/to/lib/limonade.php
            [line] => 399
            [function] => halt
            [args] => Array
                (
                    [0] => 501
                    [1] => The requested method <code>''</code> is not implemented
                )
    
        )
    
    [9] => Array
        (
            [file] => /path/to/examples/example01/index.php
            [line] => 90
            [function] => run
            [args] => Array
                (
                )
    
        )
    

    )

    September 21st, 2009 @ 11:20 AM

  3. sanemat
  4. Fabrice Luraine
    Fabrice Luraine
    • State changed from new to open

    Thks,

    it's crazy that this PHP bug still exists. I've never encounterd it before with Limonade. Have you set your auto_globals_jit off to see if it's really the same bug as described in http://bugs.php.net/bug.php?id=29176 ?

    October 1st, 2009 @ 09:40 AM

  5. sanemat
    sanemat

    I set auto_globals_jit on.
    because php default setting is set it on.
    http://jp.php.net/manual/en/ini.core.php#ini.auto-globals-jit

    In production environment, i set it off (also use APC).
    but develop environment, i set it on (because default setting).
    I home limonade does not depend on setting not default.

    October 2nd, 2009 @ 10:06 PM

  6. Fabrice Luraine
    Fabrice Luraine

    Ok,
    so it's not really clear that it's the same bug as describe in http://bugs.php.net/bug.php?id=29176 (it says at the end that it depends on auto_globals_jit)
    I've never encountered this problem on osx/php5.2.9 nor in a production server with debian/php5.2.11, both with default settings. I'll try with CentOS when i'll have more time (i really like to find where this PHP bug comes from).
    But meanwhile, we can write something less hacky that fixes the problem:

        // line 453:
        $glo_names = array('SERVER', 'FILES', 'REQUEST', 'SESSION', 'ENV', 'COOKIE');
          
        $vars = array_merge($glo_names, request_methods());
        foreach($vars as $var)
        {
          $varname = "_$var";
          // if(!array_key_exists($varname, $GLOBALS)) $GLOBALS[$varname] = array();
          if(!array_key_exists($varname, $GLOBALS)) $GLOBALS[$varname] =& isset($$varname) ? $$varname : array();
          $env[$var] =& $GLOBALS[$varname];
        }
    

    can you please tell me if it's ok with this ?
    thx

    October 3rd, 2009 @ 12:07 PM

  7. sanemat
    sanemat

    Apache/2.2.3, CentOS/5.2, PHP/5.2.8

    ticket-29-7 raise syntax error.

    $ php -l lib/limonade.php PHP Parse error: syntax error, unexpected T_ISSET, expecting T_NEW or T_STRING or T_VARIABLE or '$' in lib/limonade.php on line 460
    Errors parsing lib/limonade.php

    October 4th, 2009 @ 07:29 PM

  8. Fabrice Luraine
    Fabrice Luraine

    oops, sorry

    because of auto_globals_jit, superglobals are not accessible through $$varname, they must be called first explicitly. I will try another way to solve that.

    October 5th, 2009 @ 09:59 AM

  9. Fabrice Luraine
    Fabrice Luraine

    i finaly wrote something closest from your patch.
    tell me if it's ok

    October 5th, 2009 @ 11:58 AM

  10. sanemat
    sanemat

    ok!
    Apache/2.2.3, CentOS/5.2, PHP/5.2.8
    greate

    thank you for coping my report.

    October 5th, 2009 @ 03:30 PM

  11. Fabrice Luraine
  12. Fabrice Luraine
    Fabrice Luraine
    • State changed from open to resolved

    (from [fd16006d261ccf1dea24127e70a782af7034ab09]) Fixing empty $GLOBALS['_SERVER'] bug with Apache/2.2.3, CentOS/5.2, PHP/5.2.8 [#29 $env is empty state:resolved] http://github.com/sofadesign/limonade/commit/fd16006d261ccf1dea2412...

    October 5th, 2009 @ 06:42 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.