Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Custom PHP 4/5 CGI and $HTTP_POST_VARS problem

Discussion in 'General Discussion' started by kinsky, Jan 15, 2007.

  1. kinsky

    kinsky Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    156
    Hi all

    I configure PHP version 4.4.4 and 5.2.0 add the following syntax :

    ./configure --prefix=/usr/local/php4 --exec-prefix=/usr/local/php4 --program-suffix=4

    and

    ./configure --prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --program-suffix=5

    after make install, i copy the binary from /usr/local/php4/bin/php4 and /usr/local/php5/bin/php5 to /usr/local/cpanel/cgi-sys/

    and I modify httpd.conf, replace all of Action application/x-httpd-php to
    Action application/x-httpd-php4 "/cgi-sys/php4"
    AddType application/x-httpd-php4 .php
    AddType application/x-httpd-php4 .php4
    AddType application/x-httpd-php4 .php3
    AddType application/x-httpd-php5-source .phps
    AddType application/x-httpd-php4 .phtml
    Action application/x-httpd-php5 "/cgi-sys/php5"
    AddType application/x-httpd-php5 .php5

    I create phpinfo file with .php4 and .php5 extension, check it via browser and everything go fine.

    Now I have a problem with $HTTP_POST_VARS. Everytime i send variable using POST method, the value always null. But if I use GET method and i check the value of $HTTP_GET_VARS, it work.

    Any help would be great, thanks!
     
    #1 kinsky, Jan 15, 2007
    Last edited: Jan 18, 2007
  2. Nhojohl

    Nhojohl Well-Known Member

    Joined:
    Nov 28, 2006
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    166
    I was told by a friend that $_HTTP_XXX_VARS was going to be depricated anyway...

    Use $_GET and $_POST.
     
  3. kinsky

    kinsky Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    156
    Still don't work
    i try to change my scripts from $_HTTP_POST_VARS with $_POST and still null values..
    but $_GET work properly as $_HTTP_GET_VARS.

    Now all of applications that use LOGIN with POST METHOD are not working..
    Did i miss something on my php configurations ?

    Any help would be great, thanks!
     
  4. Nhojohl

    Nhojohl Well-Known Member

    Joined:
    Nov 28, 2006
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    166
    What's your php.ini look like?
     
  5. kinsky

    kinsky Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    156
    * Nhojohl

    Well i can not post my php.ini (4 and 5) here because it's too long.. only 10000 characters long allowed. May i know your email address so i can send it directly to you ?


    Regards
     
  6. kinsky

    kinsky Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    156
    It's strange... this is my simple code.

    Code:
    <?
    #cek.php
    error_reporting(E_ALL);
    print('<pre>');
    print_r($HTTP_POST_VARS);
    print_r($_POST);
    print_r($HTTP_GET_VARS);
    print_r($_GET);
    print('<pre>');
    ?>
    <html>
    <body>
    <form name="test" action="cek.php" method="post">
    <input type="text" name="a"><input type="text" name="b"><br>
    <input type="submit">
    </form>
    <form name="test" action="cek.php" method="get">
    <input type="text" name="c"><input type="text" name="d"><br>
    <input type="submit">
    </form>
    </body>
    </html>
    
    when i run via browser using PHP 4 CGI default from WHM both $_POST and $HTTP_POST_VARS or $_GET and $HTTP_GET_VARS can show the entered values

    but same code if i run using my custom PHP 4 CGI only $_GET and $HTTP_GET_VARS can show the entered values

    both PHP are using a same file for php.ini

    :confused:

    Any help please....... thanks
     
  7. kinsky

    kinsky Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    156
    Problem Solved !!!!!!!!!

    i put mark '#' these lines from my httpd.conf

    #LoadModule bandwidth_module libexec/mod_bandwidth.so
    and
    #AddModule mod_bandwidth.c

    restart apache

    now $_POST and $HTTP_POST_VARS are working well

    ;) :D
     
  8. Denis Y. Frolov

    Denis Y. Frolov Registered

    Joined:
    Feb 19, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    151
    But it not the decision of a problem, I have collided with the same trouble what to do??
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice