Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    4

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

    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. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Empty @_GET variable = how to change max variable length?

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Registered User
    Join Date
    May 2011
    Posts
    4

    Default Re: Empty @_GET variable = how to change max variable length?

    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. #4
    Registered User
    Join Date
    May 2011
    Posts
    4

    Default [solved] Re: Empty $_GET variable = how to change max variable length?

    It was suhosin that was limiting the variable length.

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

  5. #5
    Registered User
    Join Date
    May 2011
    Posts
    4

    Default Re: Empty @_GET variable = how to change max variable length?

    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. #6
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Empty @_GET variable = how to change max variable length?

    You may see some errors in the suphp_log file as well as the error_log file at /usr/local/apache/logs location.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. suhosin GET variable value length limit exceeded
    By Tymsah in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 07-24-2008, 08:12 AM
  2. Replies: 1
    Last Post: 04-23-2006, 03:40 AM
  3. How to change default character_set_system variable?
    By the_bobara in forum New User Questions
    Replies: 1
    Last Post: 03-14-2005, 05:34 AM
  4. Whats the easiest way to change the PATH variable serverwide?
    By AbeFroman in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-26-2004, 01:48 PM
  5. hasshell variable
    By dgbaker in forum Themes and Branding
    Replies: 0
    Last Post: 12-02-2002, 07:01 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube