I think there is an issue with PHP5.3 in cgi mode. I tried this under Debian Lenny and Ubuntu Lucid:
- Fresh install of Ubuntu / Debian with Virtualmin PHP Running in cgi mode
- php File with print_r( $PHP_SELF) and print_r($_SERVER['PHP_SELF']);
- The output is: /cgi-bin/php5.cgi but should be test.php
Maybe there is an issue with your php5.cgi script under cgi-bin? Please take a look at it.
BTW: I found this issue while debugging wordpress, which is not running under PHP5.3 in cgi mode. in fcgi mode it works fine.