use PHP_SELF to check for file existence

fixes regression introduced in 2918ae9c7ab86208be25d5652d94c14685c59faa (see #3910)