1

In my phpinfo(), in the section Apache Environment, i want change the value of the variable PATH. This is possible ?

EDIT 1:

I try SetEnv PATH /mypath in httpd.conf on a centos server, restart service and verify the change i see again a phpinfo(), and not change.

EDIT 2:

I edit the /etc/profile and add the PATH variable for all linux users,( but i cant restart the entire server for apply this change).

richie-torres
  • 113
  • 1
  • 4

1 Answers1

1

You can use putenv(), example adding "/foo":

php > putenv('PATH=' . getenv('PATH')); print_r(getenv('PATH'));
/home/jpic/env/bin:/home/jpic/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
php > putenv('PATH=' . getenv('PATH') . ':' . '/foo'); print_r(getenv('PATH'));
/home/jpic/env/bin:/home/jpic/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/foo
jpic
  • 242
  • 1
  • 3
  • 14