6

How do I create a phprc file via FTP?

 3 years ago
source link: https://help.dreamhost.com/hc/en-us/articles/214894037-How-do-I-create-a-phprc-file-via-FTP-
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How do I create a phprc file via FTP?

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.

Overview

Every installation of PHP comes with default settings which are usually fine for most websites. Occasionally, the needs of a website make 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: 2018-12_3rdparty_filezilla_phprc_01.png
  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. 2018-12_3rdparty_filezilla_phprc_02.png
  3. In the user's directory, click into the .php directory which should already exist. 2018-12_3rdparty_filezilla_phprc_03.png
  4. In the .php directory you will see several folders for the different versions of PHP. Click into the version your site is running. Remember to first check which version of PHP your site is using.
  5. In this directory you'll see a phprc file. 2018-12_3rdparty_filezilla_phprc_04.png
  6. Right-click on the phprc file, and then choose View/Edit.

    If this is the first time you've opened this file on a Windows computer, you may see the following warning.

    filezilla-warning.png

    Check the box titled Always use selection for all unassociated files and click OK.

    2018-12_3rdparty_filezilla_phprc_05.png

    A default text editor opens for you to add your customizations

    dh-kb-important-icon.svg

    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
    zend_extension=opcache.so
    ; }}} 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.

  7. Enter any of your customizations below that line. 2018-12_3rdparty_filezilla_phprc_06.png
  8. When you try to save this file in Filezilla, the following pop-up box opens.
  9. Check the box which says Finish editing and delete local file, 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 domains where two are running PHP 7.3 and the third is running PHP 7.4, only the first two domains running 7.3 would be affected by the phprc file. You would need to create a separate phprc file for the PHP 7.4 site.

See also

Did this article answer your questions?


Recommend

  • 59
    • blog.51cto.com 6 years ago
    • Cache

    FTP 原理-JUST DO IT

                  1.  什么是FTP协议?File Transfer Protocol      &...

  • 0
    • help.dreamhost.com 3 years ago
    • Cache

    My phprc file isn't updating

    My phprc file isn't updating Overview It’s possible that even if you’ve correctly added the phprc...

  • 4
    • help.dreamhost.com 3 years ago
    • Cache

    How do I create a phprc file via SSH?

    How do I 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 ma...

  • 0
    • help.dreamhost.com 3 years ago
    • Cache

    Creating and editing a file via SSH

    Creating and editing a file via SSH Overview There are a few different ways to create and edit a file when logged into a DreamHost server via

  • 2
    • www.codesd.com 2 years ago
    • Cache

    Failed to add HTML file via jquery

    Failed to add HTML file via jquery advertisements I know this question has been asked several times but I am experiencing problem with this. I...

  • 8

    In a recent internal application, I was asked to provide a way to upload a backup to the application. This is a fairly isolated implementation that may useful for others. Our tech stack looks like: Server:

  • 5

    Android FTP File Transfer via Explicit TLS advertisements I'm posting this question after have tried over and over again to get...

  • 6

    File transfers via the parallel port on DOS using LapLink Fun with LapLink 5 and parallel port file transfers under FreeDOS April 13, 2022 · 3 min I’...

  • 10

    FTP stands for File Transfer Protocol. This is a network/communication protocol for transferring files between computers over a TCP/IP (Transmission Control Protocol/Internet Protocol) network. Examples of TCP/IP networks are:HT...

  • 5
    • www.geeksforgeeks.org 1 year ago
    • Cache

    File Transfer Protocol (FTP) | It's Working

    File Transfer Protocol (FTP)Skip to content

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK