On my other host, which only allows php as cgi, you can put a php.ini file in what ever directory you want the settings to effect. I didn’t try it while I was with dreamhost, but it would be fairly easy to test.
create a php.ini with the new directives. Then run phpInfo and see if the setting changes.
I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(No longer hosted with Dreamhost)