Move around/add PHP_SAPI check, making find-entries happier.

Change-Id: Ic166066a543c4a5c0958351fdfe5f984e8d443d7
Merge "Move around/add PHP_SAPI check, making find-entries happier."