Apache & PHP Customization

← Go Back

Modifying Environmental Variables

Modifying your Apache or PHP Variables can break the compilation of Apache. cPanel is not responsible for custom changes and provides no warranty of any kind with this information. Proceed with caution.

EasyApache has the ability to let you change, add, or append to any environment variables you may want. These changes must be made on the command line before running /scripts/easyapache or Apache Update through WHM.

Adding or Changing Variables

First, create a file in /var/cpanel/easy/apache/rawenv/ with the name of the environmental variable.

For example, you could edit the PATH variable by creating /var/cpanel/easy/apache/rawenv/PATH. The contents of this file should be the value of the variable. Assuming your desired $PATH is "/bin:/usr/bin:/sbin:/usr/sbin", the file would contain only: /bin:/usr/bin:/sbin:/usr/sbin

Appending Variables

However, for the PATH variable, it is not ideal to replace it as your path needs might change. Instead, you can append your PATH change by creating a /var/cpanel/easy/apache/rawenv/.append_PATH file. In that file, simply place the path you wish to append to $PATH. For example: :/home/bin

Prepending Variables

You can also prepend variables by adding a .prepend_VARIABLE file.

Skipping your Custom Options

If needed, you can skip building with these custom options by running EasyApache with the --skip-rawenv flag like so:

/scripts/easyapache --skip-rawenv

Through WHM, you can skip the options by clicking on the Help Link inside the Apache Update interface and then making sure the option for Do not use raw env support is checked.