If you need some custom PHP settings for any of your directories you will need to use a custom php.ini file. Please note that the custom php.ini file you create is only valid for the directory you upload it in. The php.ini file is a normal text file created with your text editor. In that file you must put only the changes you need done. For example, if you want to enable register_globals for one directory you must create a php.ini file and put the following line in it.
register_globals = On
If you want to have the changes for all your subdirectories under public_html you should upload the php.ini in your public_html folder and add the following line to .htaccess:
Replace username in the path above with the cPanel username of the account you are setting up the php.ini for. Once you do the changes you can verify if it works by uploading a php script info.php with the following content in it:
<? phpinfo(); ?>
If you want to add extensions, you can add it in following ways