The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Empty @_GET variable = how to change max variable length?

Discussion in 'General Discussion' started by JmsCrk, May 6, 2011.

  1. JmsCrk

    JmsCrk Registered

    Joined:
    May 6, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    We're using a php script that has a very long $_GET variable that includes some JSON.

    On our test server it works fine, but the same code on the whm / cpanel server produces an empty get variable.

    After literally hours of searching the internet and much trial and error it appears that it is simply the length of the queries that causes the $_GET to be entirely empty if it is too long.

    It is imperative that this works but I have no idea where the setting would be. I assume it is an apache thing rather than PHP?

    How can I change the max query string length? Either using WHM or directly on the server?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    What OS is your test server using? I'm asking this as it might be OS dependent. It is certainly browser dependent based on the online discussions about it. The best information I've found so far is the following:

    WWW FAQs: What is the maximum length of a URL?

    What is the PHP handler that is being used on the machine? You can get this from WHM > Apache Configuration > PHP and SuExec Configuration area.
     
  3. JmsCrk

    JmsCrk Registered

    Joined:
    May 6, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi Tristan,

    Thanks for your help!

    We've checked in various browsers and they all work on the test server but not on the live cpanel server, so it can't be a browser problem in this case.

    Also, there are no errors in the apache log which is one of the reasons I found this so hard to identify.

    The server having the issue is running Centos 5 with WHM / cPanel, PHP version is 5.2.15

    Default PHP Version (.php files) 5
    PHP 5 Handler suphp
    PHP 4 Handler none
    Apache suEXEC on


    The test server is running Debian so I guess it is possible that it is an OS issue but I hope not...
     
  4. JmsCrk

    JmsCrk Registered

    Joined:
    May 6, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    [solved] Re: Empty $_GET variable = how to change max variable length?

    It was suhosin that was limiting the variable length.

    I added
    PHP:
    suhosin.get.max_value_length 5000
    to a php.ini file in the root of the web folder and it fixed it.
     
  5. JmsCrk

    JmsCrk Registered

    Joined:
    May 6, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Wait - this did not fix it, I was wrong.

    Now when I view phpinfo it doesn't show anything about suhosin at all. Before there was a section for it.

    I can't see any suhosin errors in the apache log at /usr/local/apache/logs/error_log - is this where suhosin errors should get logged?
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You may see some errors in the suphp_log file as well as the error_log file at /usr/local/apache/logs location.
     
Loading...

Share This Page