Create a phprc file via SSH

If you find yourself in a situation that requires changes to your site, and your developer isn't available to help, DreamHost's skilled support team may be able to assist you for a small fee. You can find more information about supported services and associated costs in the DreamHost Professional Services article.


Every installation of PHP comes with default settings which are usually fine for most websites. Occasionally, the needs of a website makes it necessary to adjust these PHP settings. Creating a php.ini (phprc) file is the solution to adjust the PHP settings for your website.

The standard term for a PHP configuration file is php.ini. However, DreamHost uses the term phprc file instead. This acts the same way – only the name is different. In this article, only the term phprc is used.

You can create a phprc file using an FTP client, or by logging into the server via SSH, however creating a phprc file is easier using an FTP client. This article is for more advanced users and explains how to create this phprc file via SSH.

Adding a phprc file using SSH

  1. Log into your server via SSH. Visit the following article for instructions on how to do this based on which operating system you’re using:
  2. Make sure you’re in your user's directory by typing in pwd to confirm:
    [server]$ pwd 

    Remember to first check which version of PHP your site is using. In the following example, the site is using PHP 8.3. In this directory, you can run a single command to create the /.php folder as well as the /8.3 folder that goes inside it.

  3. Run the following command to change into the .phprc directory:
    [server]$ cd ~/.php

    If you find this directory does not exist under your user, you can simply create the .php directory along with the nested subdirectories for any PHP versions you are using.

    3.1 - Use the mkdir command to create the .php directory.

    [server]$ mkdir ~/.php

    3.2 - Change into this new directory.

    [server]$ cd ~/.php

    3.3 - Create any subdirectories for the specific version of PHP you're creating a phprc file for.

    [server]$ mkdir 8.3
  4. Change into the directory of the PHP version your site is using:
    [server]$ cd 8.3
    • When you run pwd, you now see the entire filepath you just created:
    [server]$ pwd
  5. In this folder, create the phprc file without an extension.

    There are a few programs you can run to create this file. This example uses a program called nano. View the 'Creating and editing a file via SSH' article for further details.

  6. Run the following to create the phprc file.
    [server]$ nano phprc
    • The nano text editor opens.
  7. Edit the file with all of your PHP customizations.

    When you originally open this file, you will notice the following lines of code added by DreamHost.

    ; {{{ The following lines were automatically added by DreamHost
    ; }}} That's all from DreamHost

    Your code should be placed below the DreamHost code block. Do not add any lines within the beginning and ending semicolons.

    If you place your code within the semicolons, it will be overwritten by the server.

  8. Close the file and return to your shell.

Killing off running PHP processes

After you've saved your changes, you should kill off all running PHP processes. This ensures your new settings are updated. View the following article for instructions on how to kill off all running PHP processes:

Confirming your changes

After you've edited the file and killed off all PHP processes, you should check to confirm the values have updated. You can do this by creating a phpinfo.php file.

If you do not see your changes have updated, try killing off your PHP processes again:


The phprc file you just created is used for any domains under this specific username that are also running the specific version of PHP you chose in step#3 when creating the directory.

For example, if the user has three domains where two are running PHP 8.3 and the third is running PHP 8.2, only the first two domains running 8.3 would be affected by the phprc file. You would need to create a separate phprc file for the PHP 8.2 site.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?