How do I create a phprc file via FTP?

Overview

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 uses Filezilla as the FTP client.

Adding a phprc file through Filezilla

  1. Log into your web server via FTP. Visit the following article for detailed instructions:
  2. Make sure you’re in your user's directory.
    You can see this in Filezilla in the ‘Remote site:’ field. It will say "/home/username".
    02 phpini Filezilla Create php folder.fw.png
  3. In the users directory, right-click your mouse and select Create directory.
    03 phpini Filezilla name php folder.fw.png
  4. Name this directory .php. Make sure you add the period at the beginning of this folder name or it will not work. If you can’t see this directory, visit the following article on how to enable hidden files:
    04 phpini Filezilla create php55 folder.fw.png
  5. Click into this new .php directory, and then create another directory.
    05 phpini Filezilla name php55 folder.fw.png
  6. Create a folder named ‘5.6’.

    Remember to first check which version of PHP your site is using. In this example, we’ll assume the site is using PHP 5.6. If your site is running PHP 7, the directory would be named 7.0 instead.

    The name of this directory is the version of PHP you’re using. In this example the site is running PHP 5.6.
    06 phpini Filezilla create phprc file.fw.png
  7. Click into this 5.6 folder, and then right-click and choose Create new file.
    07 phpini Filezilla name phprc file.fw.png
  8. Name the new file 'phprc'. DO NOT add a file extension, as the phprc file should never have an extension.
    08 phpini Filezilla edit phprc file.fw.png
  9. Right-click on the phprc file, and then choose View/Edit.
    A default text editor opens for you to add your customizations. These examples are very general – adjust as needed for your site.
    09 phpini Filezilla add content to phprc.fw.png
    When you try to save this file in Filezilla, the following pop-up box opens.
    10 phpini Filezilla save content to phprc.fw.png
  10. Check the box which says ‘Finish editing and delete local file’, and then click the Yes button to save.

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 do this in your panel:

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:

Summary

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#6 when creating the directory. 

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

See also

Did this article answer your questions?

Article last updated .