PDA

View Full Version : vbulletin and general quercus use


mrtom
01-21-2010, 08:14 PM
Hello,

I've been playing around with quercus today in order to see how feasible it will be to be able to integrate PHP with our Java platform. Installing wordpress was nice and simple and very impressive.

My next application was vbulletin (v3.something). Despite it seeming to work initially, it became apparent that I couldn't modify or edit users, or post to forums. I've tried to do some debugging but not (yet) been able to get to the bottom of things - all I know is that some SQL isn't being executed. I notice that this forum is also running vbulletin v3 and have also seen the recent post regarding v4 so if anyone has experience with my problem I'd love to hear.

In general, are issues with existing PHP software expected during migration or does it just usually highlight obscure corners of PHP? Are there any suggested best practices for portable code (eg. thread safe code)?

Regards,
Tom

mrtom
01-22-2010, 12:26 PM
(Apologies for the initial double post)

I've managed to find the code causing problems in vbulletin. I'm not a PHP coder and barely understand what I have found.

The line

$this->{$table}["$fieldname"] =& $value;

where $table evaluates to 'user', which is an array, causes an incorrect assignment of $this->user.

If I create a new variable and split the work up over two lines it works fine....

$arr = $this->{$table};
$arr["$fieldname"] =& $value;

I'm guessing this is a bug in quercus but I'm willing to be educated further ;-)


Regards,
Tom

nam
01-23-2010, 12:28 AM
Thanks for the detective work. This was working in 4.0.1 and it broke in 4.0.3. I've added a bug report at:

http://bugs.caucho.com/view.php?id=3857

derickso
02-02-2010, 05:34 AM
I didn't see this post and replied to the other duplicate thread on accident.. after you fixed that line mrtom did you run into any other issues? I'm wondering what to expect from running VB 4 inside Quercus..

Thanks!

emil
02-04-2010, 07:05 PM
I've fixed this issue for 4.0.4, due out within a couple of weeks.

derickso: We're running this forum in vBulletin on Quercus, so we're pretty investing in making sure it works. :)

Emil

derickso
02-04-2010, 08:02 PM
I figured that was the case, but right now this VBulletin is 3.8.3 not version 4.. is that because there are showstopping problems preventing it from being run on the current version of Quercus?

nam
02-05-2010, 12:50 AM
Our forums is running 3.8 because that was the latest version at the time. We always want to support the latest version, but it's always a game of catch-up. If there's an issue with vbulletin, we want to fix it for the next release.

derickso
02-05-2010, 08:36 AM
First located issue (VB 4.0.1):

PHP Code:

const CLEAN_REGEX = '`([\s/\\\?:@=+$,<>\%"\'\.\r\n\t\x00-\x1f\x7f]|(?(?<!&)#|#(?![0-9]+;))|&(?!#[0-9]+;)|(?<!&#\d|&#\d{2}|&#\d{3}|&#\d{4}|&#\d{5});)`s';


Error:

Warning: com.caucho.quercus.lib.regexp.IllegalRegexpExcepti on: conditional requires number /([\s/\\?:@=+$,<>\%"'\.\r\n\t\x00-\x1f\x7f]|(?(?forum\includes\class_friendly_url.php on line 335

These warnings are being printed out in plain text at the beginning of content that is listed as being gzip encoded, and is thus causing my browser to not be able to decode the content. To even get this error I had to use Wireshark to see what was going on. So this is really two bugs, the above issue with regex, and that warnings should be getting gzipped with the rest of the content.

Also is there some way to have warnings print to the console or redirected out through the log instead of printed on the page itself? I tried using log4j to redirect all of com.caucho out but it didn't work with this warning.

Thanks!

nam
02-06-2010, 03:23 AM
thanks derick, I've filed a bug report at:

http://bugs.caucho.com/view.php?id=3879

To disable warnings and notices, you will need to set error_reporting to 0. You can do this in a php.ini file, in your web.xml, or via a prepend file.

derickso
02-14-2010, 04:24 PM
It's not that I don't want to see the errors and warnings, its that I want them to not entirely break the page's encoding when gzip is being used. It would be ideal if via log4j or some other mechanism you could send these somewhere other than to the rendered page's output.

nam
02-21-2010, 04:26 AM
warnings and errors shouldn't break gzip encoding, unless that warning appears before the app is able to start the gzip filter

Quercus logs all warnings and errors to the Java logger at the FINEST level, so you can set error_reporting(0) and still get warnings in your logs.

derickso
02-25-2010, 03:45 AM
In this case it did, the following is taken straight from Wireshark:


GET /forum/index.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, */*
Accept-Language: en-us
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729)
Host: 192.168.110.2:8080
Connection: Keep-Alive
Cookie: bb_lastvisit=1265361796; bb_lastactivity=0

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: bb_lastvisit=1265361796; Expires=Fri, 25-Feb-2011 04:42:38 GMT; Path=/forum/
Set-Cookie: bb_lastactivity=0; Expires=Fri, 25-Feb-2011 04:42:38 GMT; Path=/forum/
Cache-Control: private
Pragma: private
Content-Encoding: gzip
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 4877
Date: Thu, 25 Feb 2010 04:42:38 GMT

<br /><strong>Warning</strong>: com.caucho.quercus.lib.regexp.IllegalRegexpExcepti on: conditional requires number /([\s/\\?:@=+$,<>\%"'\.\r\n\t\x00-\x1f\x7f]|(?(?<!&)#|#(?![0-9]+;))|&(?!#[0-9]+;)|(?<!&#\d|&#\d{2}|&#\d{3}|&#\d{4}|&#\d{5});)/ [preg_replace] in <strong>D:\projects\onlinesagas\web\src\web\forum\includes \class_friendly_url.php</strong> on line <strong>335</strong><br /><br /><strong>Warning</strong>: com.caucho.quercus.lib.regexp.IllegalRegexpExcepti on: conditional requires number /([\s/\\?:@=+$,<>\%"'\.\r\n\t\x00-\x1f\x7f]|(?(?<!&)#|#(?![0-9]+;))|&(?!#[0-9]+;)|(?<!&#\d|&#\d{2}|&#\d{3}|&#\d{4}|&#\d{5});)/ [preg_replace] in <strong>D:\projects\onlinesagas\web\src\web\forum\includes \class_friendly_url.php</strong> on line <strong>335</strong><br /><br /><strong>Warning</strong>: com.caucho.quercus.lib.regexp.IllegalRegexpExcepti on: conditional requires number /([\s/\\?:@=+$,<>\%"'\.\r\n\t\x00-\x1f\x7f]|(?(?<!&)#|#(?![0-9]+;))|&(?!#[0-9]+;)|(?<!&#\d|&#\d{2}|&#\d{3}|&#\d{4}|&#\d{5});)/ [preg_replace] in <strong>D:\projects\onlinesagas\web\src\web\forum\includes \class_friendly_url.php</strong> on line <strong>335</strong><br />...........[{o.F......f.@...(;n.'...qZ..I6v.-.........|H.........I=l'..Ml........../...^...L$.<..?..8?.^...~r...._...x}y!...q].y.V.......z.K.j...W.U..........D..i.y.U........_y .O.,/G[..........b.eU..,.g#O..H.....Y&.4....*.....sY. .Z...u..y.*.d^..o....~.y..T.4.....(e5:.z.{......'| ..a..2XN.z.&...<..sIxt..l..LEa...z.l.l.OUQ..IXJ..r.X.m.O.....~M... ......h.U.q:...shj.f2.EX)..a.|e.%.........,.-=.F..T..........dR..i..e.e8..b.."..ua....tA...{....O..[`.W........V8...Z.i..B...'..u.....b...t......}...<...
.`4..p..VO.E4..,...&..N.7Sa,.^..=.D...............t.......2"...co.._..!....a!..........B....p...?._.r...go.gV. .r...?.>..\._.Rg:.g.......W....1.3hRW..K7.[.B.'.....O....w.W...w ....R.../.~:.@....\.........../.&.<.....h.S.^.
.]@.z...0K..Q.l...m&.D..k+dTb.j...."Y|.#a.......d
.....~......;.....&?2..d..X...@.),.?...^.e^.[!a.zS.....Q..^..j.a.!.V....*...v..+A..J.L... ]..p.......{.5{4.?...9..P.o.%.
gQ...X`L.#..c......s/eI.n]....e.C.8Dh8.....z...oa.H.q..Q....`..2.>o,...Pe...$@^".E%..,.$..r.+.w4.!.L.Hrx....."...o..U...X|.5.3...8.J-..c.-..ej.zl.`...L......F8.hp..N=.f....x....88....o.b.? D.p#.#...s4...[g.7Wu.Np...ME.j.R.YZV..$....Te.Zy...s..`.C......I. .....0...h\.Ks4.....W.y..v.J.C`s...D..fp.d0c5..O fK...@...8.z2O!.@M.2y.w.#.........0.......b..0...2 .aJY-.n..1...u.-.i;.g...e....;M........$b9...-..Ft..RM.i.5..Yo..i,..!.:.@_.H.%"..W....D[...!\d.#.#....M.S. p.!,}T!....1..}7l...............e...O.0.....$.IV#. ..q...@jV.......?....Z.=i....>^..p....
.S....a...N..w.@T..C.E..........,&"m..#...O!nU].+t."..h.iM..".R,
.Lc....y...
X.4.......c_h,h`TH..!.....0.W,e6E..R,.E.D..c.[/C.n"#<....B..|.2....9.'2#...O.H..T..............v+.f.c(. ...
.....-.........C.....}F...p.X.6.I...........(Q....2..... ..0Su......v...Mby......O$..&CW`...A....u.....>...q0..$......:>...&.f..2d..@@...a....U3=.~.......`...n..}......i.b'!. .......4...e.F.....&6...........J..Qb=.LV1|.-...g!!f..|........U.....x..\...z...o...o^.c...`.., *.P,.u.3>5o.3.....I......RM..U.g.yFT.B4>U.y.c..J.v;V.......\,A.l#7..v......f2C....K6....To Ygh7...ara....V...C7V.Kp+...E..$~5..M...1 c..:;...x*..K<.......t,....9.v.....4...D..Q.O.......9g.m...c.D.f ...\~.t..I.h6C.).+.Kq.9Xi...f.......U...`........f ~.M.9.+...r..M....f..#48..=.^...N#..n..E.......L+. \...Q`Z...+.pn...w....".X..D8.L.>,.an./.....L.....1.j!...?jY.:V.8. ........N.h5j...........f........V...Ep..R.....C.. .a....g....zu{.?...t.q_../.t...[.3....2..`./.<....@....h.02~i..+.
:..nX.tQ.G'...S..
..*.....;.D]f....VE.Xh......z.[?q.n5...h.....1."E...rC5...B..........d.u....U...A.7....l..4$.....~ ......+6,...:+G.D4X..DLZf. ."..e..4........i...]...6......[..{....5.~..u6.f..4..Zj.9c:S.f.%V[.j{.'....NA(4...2;...j.A..F..~..\&..''...(q.....@L.(.B"..>q..Gb....:........!#/@.%..nM..2OX3...M..Z...\.......Z..[..KZ..o...R[..#pX.+..DB+%Q$"Xx..=..si.....&....._.j..rE........u~.p.H=.SX.R.0G.Li..)..x...R5. ..g......0D.Zn.b.%|............hfh...W2.I$L9#..U.p t...C..87k....`.f..V.6.sT.....+:.J....fC.c.y4L!... I\.
HXi.m.f.L.u}x..*..8x..pQ..2..#...8w.j....z.N.:H;E. i.
...U$.[ .)%.....8.lM..\....5..u....kJ.......6....%.j5...`. o|.6..~.-....bk[... ..Y>s.... s.P.8.B.4.... ....Jux'^7G.Z...zQ.....S...B.#.#GI.....0,..WnB.... WR%.HG<xC}@...3.-...R..#$..#.....SDi.zE...w.LK.....<.+h&.@..v...#..y....[."s.H....a..y..&G..=t........-.pvM[....^0..J..vh..4@[...Y.i....,..09...
....7=]..9.s.q.-D.HE4...r..p.g....1.zw.u..@.#.....&........0....K.....jY.V..vd.L........4|q..A..j.... wN
..N....?..l....p.....A8i..5..*.......0.g;j.....%.. !T,.?...B.q..}#.9.$......./........j9Y$..q..........y..i......k...C.:... ..........2.[_.\U...x..L.2..OM.....Q...].............W..1S.|Q...G......j....!..C#.O.!...k. .N.M5.....GI..r.hM\[..........8........}J......@.U...P&L.E[.bR.d....'...8-o.Z................=0.O.&'B...p...kp"./Nl.L.94.........R...DZe....x...


Note the error HTML being prepended onto content that is supposed to be GZIP encoded...

nam
01-04-2013, 12:18 PM
It took a few years but I finally fixed the regexp bug:

http://bugs.caucho.com/view.php?id=3879