If you are looking for how to do it in the .htaccess file,
This one works:
# Change path to where YOUR site's "php.ini" file is located.
# Be sure to protect your "php.ini"
deny from all
Whoever said the suPHP is discontinued, needs to realize that most of the major web-hosting providers run such secure services like Fast-CGI, etc. from Apache. BTW: If you set up your .htacess this way, you MUST have a "php.ini" for your site as pointed to by the ConfigPath variable. YOU are responsible for the proper settings of the various PHP-environment variables to include the "include" file locations, whichever additional Apache modules you wish to preload and use, etc.
But YES, this is how you secure the execution of your PHP scripts, for your whole site if you wish.
- Dragon's Eye