On Wed, 30 Jan 2013, Ryan Dagey wrote:

> Thanks for the reply. We are simply running gretlcli from 
> within php which should execute as apache user. Now this 
> user has no home directory, so if that causes gretlcli to 
> default to root directory [...]

It doesn't: libgretl uses $HOME. If "/root" is coming into the 
picture, that must be because $HOME=/root in the environment 
in which gretlcli is running.

> Why is gretlcli requiring any user directories at all? I 
> don't understand what is derived from these directories.

In the normal use-case for gretlcli we need to know the user 
directories for writing various files, mostly pertaining to 
auxiliary programs such as gnuplot, X-12-ARIMA, the programs 
supported by the "foreign" comand and so on.

> It would be good if this is the case to review some 
> documentation on the required directories, I did a lot of 
> googling looking for them.

In the normal use-case these are supposed to "just work", you 
don't need to know about them. Obviously your case is 
different, and I'll have to think aout it.

> Am I understanding that all of those environment variables 
> have to be set every time in PHP to some temporary directory 
> just to get gretlcli to run in PHP under the apache user? 
> There is no way to tell gretlcli to use some set of 
> defaults?

Environment variables are just one way to get gretlcli to use 
a set of defaults that work for your usage of the program via 
PHP (since the built-in defaults are problematic in this 
case).

However, it may be that we can come up with an option that 
says to gretlcli something like, "There's nobody here, don't 
read any user config." But you'd still need a user directory 
(however defined and wherever located) if you want gretlcli to 
be able to interact with third-party programs (gnuplot, etc.).

Allin Cottrell

Reply via email to