Normally you change PHP settings in a file called php.ini that PHP loads when bootstrap. In Dreamhost you use a file called “phprc” that resides in a sub-directory “/.php” in your user home.


There is one folder for every installed PHP version.
When you open the “phprc” file in a text editor you see some code there. This is manage by the server and will be overwritten if you put something there.

Put your code after this part and save.

After that you need to restart php. In Dreamhost shared you have to kill all running processes.
Log in to your server and run the following code:
killall -9 php84.cgi -u shelluser
Change “php84” to right version and “shelluser” to username of website runs under. (the user you logged in ssh)
Check with a phpinfo file

Links:
https://help.dreamhost.com/hc/en-us/articles/214894037-Create-a-phprc-file-via-FTP
https://help.dreamhost.com/hc/en-us/articles/214895287-Viewing-your-site-s-PHP-version-and-settings