I can complete his problem (seeing that I have the same issue), and this will maybe help pandianbe:
The error is that his php5 is running thru CGI and not the mod through APACHE. I assume that his PHP4 currently runs on MOD thru Apache and PHP5 is optional run through CGI.
The error makes alll his links display as:
http://domain/cgi-sys/php5/galleries/themes/default/dynamics.js (and we mean ALL the links, stylesheets, photos ect) and not http://domain/galleries/themes/default/dynamics.js.
The only work around I found was to set my default PHP version on that domain to PHP4 so that it does not change the links, unless anyone else has a solution to this problem?