PHP 4.2.3 BUG IN LAST CPANEL APACHE.

cass

Well-Known Member
Jul 17, 2002
354
0
166
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)
 

cass

Well-Known Member
Jul 17, 2002
354
0
166
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.
 

cass

Well-Known Member
Jul 17, 2002
354
0
166
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!
 

cass

Well-Known Member
Jul 17, 2002
354
0
166
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.
 

ahwheelock

Well-Known Member
Nov 5, 2001
49
0
306
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.