0

I have a lot of variables in the Configuration->Environment section of PHP info that were included on my old server but are missing on my new server.

Old server

  • PHP 5.2.6
  • Apache/2.2.10
  • Linux/SUSE

New server

  • PHP 5.6.31.
  • Apache/2.4.6
  • Red Hat Enterprise Linux

Variables:

_
COLORTERM
COLUMNS
CPU
CSHEDIT
DAEMON
EDITOR
ENV
FROM_HEADER
G_BROKEN_FILENAMES
get_includes_done
get_module_list_done
HISTSIZE
HOME
HOST
HOSTNAME
HOSTTYPE
INFODIR
INFOPATH
INPUTRC
LANG
LC_ALL
LC_CTYPE
LESS
LESS_ADVANCED_PREPROCESSOR
LESSCLOSE
LESSKEY
LESSOPEN
LINES
LOGNAME
LS_COLORS
LS_OPTIONS
MACHTYPE
MAIL
MANPATH
MINICOM
MORE
NNTPSERVER
OSTYPE
PAGER
PATH
PREVLEVEL
PROFILEREAD
PWD
PYTHONSTARTUP
QT_HOME_DIR
RUNLEVEL
SHELL
SHLVL
SSH_CLIENT
SSH_CONNECTION
SSH_TTY
TERM
USER
WINDOWMANAGER
XCURSOR_THEME
XDG_CONFIG_DIRS
XDG_DATA_DIRS
XKEYSYMDB
XNLSPATH

How do I go about setting this variables? I have tried to find some of them. For example XKEYSYMDB is being set in /etc/csh.login on the old server, but that is no where no be found on the new server.

I don't know if these are values that need to be set. I can't seem to find any documentation on them.

AllisonC
  • 2,973
  • 4
  • 29
  • 46
  • In your `.profile` file you need to export each one of them so the values will persist, for example `export VARNAME="my_value"` – Jahil Khalfe Sep 28 '17 at 14:32
  • 1
    Most of them are standard and they are not needed by the PHP scripts, in general (and some of them, like `COLUMNS` or `HISTSIZE` are completely useless to them). Check first if and how the application works on the new server. You can also search for `getenv()`, `putenv()` and `$_ENV` in the PHP code to find out if any environment variable is important for it. – axiac Sep 28 '17 at 14:33
  • In Apache, you would set environment variables in Apache's virtualhost file. They can also be in the site-level `.htaccess` file if you have [that feature](https://stackoverflow.com/questions/17550223/set-an-environment-variable-in-htaccess-and-retrieve-it-in-php) enabled. That said, I'd give running your application a try with the stock installation. Given the list you've provided, there's a good chance most, if not all of those, don't need to be explicitly set. Your application should crash and burn pretty horribly if it depends on them and they're not there. (If you don't want to do this on – Shauna Sep 28 '17 at 14:33

0 Answers0