#29 ✓resolved
sanemat

$env is empty

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

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

Comments and changes to this ticket

  • sanemat

    sanemat September 21st, 2009 @ 11:18 AM

    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

  • sanemat

    sanemat September 21st, 2009 @ 11:20 AM

    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
                (
                )
    
        )
    

    )

  • sanemat
  • Fabrice Luraine

    Fabrice Luraine October 1st, 2009 @ 09:40 AM

    • 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 ?

  • sanemat

    sanemat October 2nd, 2009 @ 10:06 PM

    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.

  • Fabrice Luraine

    Fabrice Luraine October 3rd, 2009 @ 12:07 PM

    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

  • sanemat

    sanemat October 4th, 2009 @ 07:29 PM

    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

  • Fabrice Luraine

    Fabrice Luraine October 5th, 2009 @ 09:59 AM

    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.

  • Fabrice Luraine

    Fabrice Luraine October 5th, 2009 @ 11:58 AM

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

  • sanemat

    sanemat October 5th, 2009 @ 03:30 PM

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

    thank you for coping my report.

  • Fabrice Luraine
  • Fabrice Luraine

    Fabrice Luraine October 5th, 2009 @ 06:42 PM

    • 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 state:resolved] http://github.com/sofadesign/limonade/commit/fd16006d261ccf1dea2412...

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Limonade is a PHP micro-framework.

People watching this ticket

Attachments

Referenced by

Pages