Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Jan 2005
    Posts
    47

    Question Custom PHP 4/5 CGI and $HTTP_POST_VARS problem

    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!
    Last edited by kinsky; 01-18-2007 at 07:56 AM.

  2. #2
    Member
    Join Date
    Nov 2006
    Posts
    101

    Default

    I was told by a friend that $_HTTP_XXX_VARS was going to be depricated anyway...

    Use $_GET and $_POST.

  3. #3
    Member
    Join Date
    Jan 2005
    Posts
    47

    Default

    Quote Originally Posted by Nhojohl View Post
    I was told by a friend that $_HTTP_XXX_VARS was going to be depricated anyway...

    Use $_GET and $_POST.
    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. #4
    Member
    Join Date
    Nov 2006
    Posts
    101

    Default

    What's your php.ini look like?

  5. #5
    Member
    Join Date
    Jan 2005
    Posts
    47

    Default

    * 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. #6
    Member
    Join Date
    Jan 2005
    Posts
    47

    Default

    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



    Any help please....... thanks

  7. #7
    Member
    Join Date
    Jan 2005
    Posts
    47

    Default

    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


  8. #8
    Registered User
    Join Date
    Feb 2007
    Posts
    4

    Default

    But it not the decision of a problem, I have collided with the same trouble what to do??

Similar Threads & Tags
Similar threads

  1. custom php.ini with php handler set as cgi
    By johny_gjx in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-16-2009, 03:54 AM
  2. Security Problem when php run as cgi or suphp !!
    By ktjm in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-15-2008, 02:30 AM
  3. CGI and PHP HTTP_REFERER Problem
    By HostCentury in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-05-2004, 08:53 AM
  4. CGI & PHP Referer Problem
    By ashish9 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-18-2003, 05:19 AM
  5. Nobody-Mail-Problem with PHP & CGI-Scripts
    By JapAniManga.ch in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-08-2002, 02:01 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube