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.

PHP 4.2.3 BUG IN LAST CPANEL APACHE.

Discussion in 'EasyApache' started by cass, Nov 3, 2002.

  1. cass

    cass Well-Known Member

    Joined:
    Jul 17, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Argentina/USA/Mexico
    The bug : http://bugs.php.net/bug.php?id=20114

    A possible solution? (from the MB forums...)

    [quote:998f165c27]
    PHP 4.2.3 (Cpanel Tutorial)
    If you have a cpanel server, I wrote this tutorial for our dedicated customers:

    Step One

    cd /home/cpapachebuild/buildapache/php-4.2.3

    Step Two

    './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mcrypt=/usr/lib/libmcrypt' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--with-gd=../gd-1.8.4' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-imap' '--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-safe-mode' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--enable-versioning' '--with-zlib'

    Step Three

    make

    Step Four

    make install

    Step Five

    cd /home/cpapachebuild/buildapache/

    Step Six

    touch 4.2.3-patch

    Step Seven

    pico -w 4.2.3-patch

    Step Eight

    --- php-4.2.3/ext/mbstring/mbstring.c.org 2002-09-19 22:32:22.000000000
    +0200
    +++ php-4.2.3/ext/mbstring/mbstring.c 2002-09-19 22:29:32.000000000
    +0200
    @@ -1031,15 +1031,18 @@
    var = php_strtok_r(res, separator, &strtok_buf);
    while (var) {
    val = strchr(var, '=');
    - val_list[n] = var;
    - len_list[n] = php_url_decode(var, strlen(var));
    - n++;
    if (val) { /* have a value */
    *val++ = '\0';
    + val_list[n] = var;
    + len_list[n] = php_url_decode(var, strlen(var));
    + n++;
    val_list[n] = val;
    len_list[n] = php_url_decode(val, strlen(val));
    } else {
    - val_list[n] = &&;
    + val_list[n] = var;
    + len_list[n] = php_url_decode(var, strlen(var));
    + n++;
    + val_list[n] = &&;
    len_list[n] = 0;
    }
    n++;
    ----------------

    Step Nine

    patch & 4.2.3-patch

    Step Ten

    php-4.2.3/ext/mbstring/mbstring.c

    Step Eleven

    './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mcrypt=/usr/lib/libmcrypt' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--with-gd=../gd-1.8.4' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-imap' '--with-kerberos' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-safe-mode' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--enable-versioning' '--with-zlib'

    Step Twelve

    make

    Step Thirteen

    make install

    Step Fourteen

    service httpd restart
    [/quote:998f165c27]

    I dont know if this works or not ...
    NICK... can you please make a new build apache with this?
    or another solution ... I have compiled apache 3 times in the last hours.... and I keep getting the error.

    Also... here you can view it working:
    http://www.cascompany.com/phpbug.php

    (if I make it work... I will remove this link... heh)
     
  2. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    362
    Likes Received:
    0
    Trophy Points:
    16
    Any luck yet? I need this fixed too...
     
  3. cass

    cass Well-Known Member

    Joined:
    Jul 17, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Argentina/USA/Mexico
    Oh, I have it working now ...

    I compiled it WITHOUT mbstring .... just this and it worked.

    this config worked for me:
    './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--with-gd=../gd-2.0.4' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib'

    hope it helps.
    Regards.
     
  4. bdraco

    bdraco Guest

    mbstring is disabled by default in newer buildapaches
     
  5. cass

    cass Well-Known Member

    Joined:
    Jul 17, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Argentina/USA/Mexico
    yeah, I know that, but this &patch& I posted here is supposed to FIX the problem with mbstring...

    and if you have time ... maybe you can try & test it, and see if it works ... so you can make a new buildapache already patched.

    Thanks!
     
  6. cass

    cass Well-Known Member

    Joined:
    Jul 17, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Argentina/USA/Mexico
    Also ... to test the bug is EASY, very very EASY.

    just make a somename.php with :

    &form action=&&?=$_SELF?&& method=&POST&&
    &input name=&variable[]& value=&123456789&&
    &input name=&variable[]& value=&abcdefghi&&
    &input type=submit value=submit name=submit&
    &/form&
    &pre&
    &?=print_r($_POST);?&
    &/pre&

    save & run it ...
    if you see 56789 & efghi ... it's bad :P

    Regards.
     
  7. ahwheelock

    ahwheelock Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    another bug identified in 4.2.3....can we get a fix in the cpanel update?

    http://bugs.php.net/bug.php?id=20355


    This one strips 4 characters from form input.
     
Loading...

Share This Page