Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Apr 2016 10:22:31 +0200
From:      Luca Ferrari <fluca1978@infinito.it>
To:        Niklaas Baudet von Gersdorff <stdin@niklaas.eu>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Why is www's $PATH only /usr/bin:/bin?
Message-ID:  <CAKoxK%2B41i=viH9qy-KrnwoioRXwv7U2FYNtP8B-AQW-RmVc_6w@mail.gmail.com>
In-Reply-To: <20160427082142.fd56427e6b96fb6fb2b29035@sohara.org>
References:  <20160426194048.GA31481@box-fra-01.niklaas.eu> <20160427082142.fd56427e6b96fb6fb2b29035@sohara.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 27, 2016 at 9:21 AM, Steve O'Hara-Smith <steve@sohara.org> wrote:
> On Tue, 26 Apr 2016 21:40:48 +0200
>         ... and indeed cannot log in so the login.conf is not going to
> apply. It is also possible (indeed likely) that the web server deliberately
> minimises the path passed to CGI scripts for security.

Exactly. You have to think that PATH can be changed by the running
process, so there is no surprise that is either expanded or shrinked.

>> The thing is that I want to run something in /usr/local/bin with PHP's
>>
>>     shell_exec($cmd);
>>
>> but that's not working because it's not in $PATH.

I would suggest to either add the path to the php config or to make a
php function to build the absolute path for command based on your
installation or some other condition. That would make the application
portable.


Luca



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKoxK%2B41i=viH9qy-KrnwoioRXwv7U2FYNtP8B-AQW-RmVc_6w>