Ask Your Question
1

$HOME is not set when calling through sage -python and PHP

asked 2014-01-27 01:33:36 +0100

kasuals gravatar image

I am making a PHP exec() call to a python script that imports sage. sage -python executes it, but thinks that $HOME is not set. The user for Apache is www-data, and /var/www is set in the passwd file for it's home path.

Here is the error from sage in my Apache error.log:

Error: environment variable $HOME is not set. Error setting environment variables by sourcing '/usr/lib/sagemath/spkg/bin/sage-env'; possibly contact sage-devel

HOME is set for the user executing the script (www-data) and is set to /var/www, so when www-data executes it, $HOME should be set yes? Is this a setting I'm missing in my sage-env?

Thank you in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-01-29 19:24:54 +0100

p3d40 gravatar image

I had the same problem and what I did was to set the HOME variable in the apache configuration file.

http://httpd.apache.org/docs/2.2/env....

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-01-27 01:33:36 +0100

Seen: 1,018 times

Last updated: Jan 29 '14