Ask Your Question

kasuals's profile - activity

2017-11-04 05:36:48 +0100 received badge  Famous Question (source)
2015-11-08 07:13:39 +0100 received badge  Taxonomist
2015-09-22 09:39:47 +0100 received badge  Popular Question (source)
2015-09-22 09:39:47 +0100 received badge  Notable Question (source)
2014-02-05 12:44:57 +0100 received badge  Student (source)
2014-01-27 01:33:36 +0100 asked a question $HOME is not set when calling through sage -python and PHP

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!