$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!