cPanel & WHM no longer develops EasyApache 3 and only releases security updates for it. We will deprecate EasyApache 3 on December 31, 2018. After that date, we will no longer update EasyApache 3. In cPanel & WHM version 78, we will remove support for EasyApache 3. For more information, read our cPanel Long-Term Support documentation. If you do not upgrade to EasyApache 4, you cannot upgrade to cPanel & WHM version 78. We strongly recommend that you upgrade to EasyApache 4. For more information, read our EasyApache 4 documentation.
Environment Variables - EasyApache - cPanel Documentation
Page tree
Skip to end of metadata
Go to start of metadata

Overview

Environment variables are containers for modifiable values that you can place within custom-created files to change the behavior of Apache and PHP.

EasyApache allows you to use the command line to change, add, or append environment variables. After you make changes to environment variables, run EasyApache via WHM (Home >> Software >> EasyApache 3) or run the/scripts/easyapache script from the command line.

Warning:

Environment variables that you modify may break Apache. cPanel takes no responsibility for custom changes, nor do we provide any warranty for what you do with this information. Proceed with caution.

How to append environment variables

Note:

We recommend that you use the append method.

You can append an additional value to a variable after the variable's original value. To do this, you will need to make a file outside of /var/cpanel/easy/apache/rawenv that houses the additional value.

To append an existing variable, perform the following steps at the command line as the root user:

  1. Create a file in the /var/cpanel/easy/apache/rawenv/ directory with the name .append_environmentvariable, where environmentvariable represents the name of the variable to which you wish to append a value.

  2. Open the file with your preferred text editor and enter the value that you wish to append to the environment variable.
  3. To add the environmental variable, run EasyApache via WHM (Home >> Software >> EasyApache 3) or run the/scripts/easyapache script from the command line.

How to add or change environment variables

Note:

We do not recommend that you add or change environment variables in the following way because your needs may change.

To add or change variables, perform the following steps at the command line as the root user:

  1. Create a file in the /var/cpanel/easy/apache/rawenv/ directory with the name of the environment variable that you wish to change.
  2. Open the file with your preferred text editor and enter the value of the environment variable.
  3. Save your changes.
  4. To add the environmental variable, run EasyApache via WHM (Home >> Software >> EasyApache 3) or run the/scripts/easyapache script from the command line.

How to prepend environment variables

You can prepend an additional value to a variable before the variable's original value.

To prepend an existing variable, perform the following steps at the command line as the root user:

  1. Create a file in the /var/cpanel/easy/apache/rawenv/ directory with the name .prepend_environmentvariable, where environmentvariable represents the name of the variable to which you wish to append a value.

  2. Open the file with your preferred text editor and enter the value that you wish to prepend to the environment variable.
  3. To add the environmental variable, run EasyApache via WHM (Home >> Software >> EasyApache 3) or run the/scripts/easyapache script from the command line.

How to skip your custom environment variables at build time

To help troubleshoot custom environment variables, you can build Apache without the custom options that you have specified.

Command line

  • Use the /scripts/easyapache --skip-rawenv command to run EasyApache.

WHM

  1. Run EasyApache via WHM (Home >> Software >> EasyApache 3).
  2. Click the Help link.
  3. Select the Do not use raw env support checkbox.
  4. Click Submit.
  5. Return to the previous screen and build the profile.

If the build completes successfully without the custom environment variables, you may need to reconfigure or omit the variables.