1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00
phorge-phorge/src
epriestley 80643d63a8 Detect empty $PATH environmental var
Summary:
By default, PHP-FMP (an alternate PHP FCGI SAPI) cleans the entire environment
for child processes. This means we have no $PATH.

This causes some confusing failures for reasons I don't fully understand. If you
do these things:

  exec_manual('env');
  exec_manual('export');

...they show no $PATH, as expected. If you do this:

  exec_manual('echo $PATH');

...it shows a path. And this works (i.e., it finds the executable):

  exec_manual('ls');

...but this fails (it says "no ls in ((null))"):

  exec_manual('which ls');

So, basically, the sh -c process itself gets a default PATH somehow, but its
children don't. I don't realllly get why this happens, but clearly an empty
$PATH is a misconfiguration, and can easily be remedied.

See discussion here: https://github.com/facebook/libphutil/issues/7

Test Plan: Applied patch to Centos6 + nginx + PHP-FPM machine, ran setup, the
configuration issue was detected and I was given information on resolving it.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D1413
2012-01-16 11:49:19 -08:00
..
aphront Improve error message for Conduit path problems 2012-01-16 11:48:21 -08:00
applications Improve error message for Conduit path problems 2012-01-16 11:48:21 -08:00
docs Minor documentation improvements 2012-01-12 20:08:19 -08:00
infrastructure Detect empty $PATH environmental var 2012-01-16 11:49:19 -08:00
storage Improve LiskDAO::__call() performance 2012-01-03 22:03:34 -08:00
view Improve behavior when user submits a no-op action in Differential 2012-01-15 03:44:09 -08:00
__celerity_resource_map__.php Display Show Raw File links in Differential only if the file exists 2012-01-16 09:08:40 -08:00
__phutil_library_init__.php Distinguish between aphront and phabricator. 2011-01-22 17:45:28 -08:00
__phutil_library_map__.php Improve error message for Conduit path problems 2012-01-16 11:48:21 -08:00