There is no such thing as "vanilla" php. index.php
is simply php, and to disable it would disable that as well. Also: If you could find a way to disable everything but index.php
, they could simply just overwrite index.php
and execute their code.
If you want to protect against hackers, look for the exploits (Where they're getting in), and patch/fix them. If you're using custom plugins, make sure they're up to date. You can also look into scripts like this that will scan files for hacks.
You can also harden PHP by disabling functionality commonly used by hackers (Be careful as this may break existing functionality of your site).