Timeline for PHP script can't get output from Python script
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 2, 2012 at 23:21 | history | edited | Dietrich Epp | CC BY-SA 3.0 |
added 66 characters in body
|
| Jan 2, 2012 at 23:18 | vote | accept | Community Bot | ||
| Jan 2, 2012 at 23:18 | comment | added | user1069895 | I was able to find the missing environment variable and set it with putenv() from PHP. Everything works now, thank you! | |
| Jan 2, 2012 at 22:02 | comment | added | Dietrich Epp |
@Neil: The difference is probably in the environment variables. There should be an environment variable you can set from PHP that causes Python to search the correct path, try comparing environment variables from PHP and SSH by running the /usr/bin/env program.
|
|
| Jan 2, 2012 at 21:54 | comment | added | user1069895 | See my update with the results. It seems Apache doesn't include the modules installed in .local. Your Linux-only line produced the error "NameError: name 'os' is not defined". | |
| Jan 2, 2012 at 21:11 | history | edited | Dietrich Epp | CC BY-SA 3.0 |
added 75 characters in body
|
| Jan 2, 2012 at 20:49 | comment | added | Dietrich Epp | @Neil: Restarting Apache (probably) won't help anyway. See edited answer. | |
| Jan 2, 2012 at 20:48 | history | edited | Dietrich Epp | CC BY-SA 3.0 |
added 624 characters in body
|
| Jan 2, 2012 at 20:15 | comment | added | David Morabito | If helps, try using a virtual environment, so you can have the SAME envs a discard environment as a problem. | |
| Jan 2, 2012 at 19:43 | comment | added | user1069895 | Just checked - they're both accessing Python 2.4.3. And being in a shared hosting environment, restarting Apache is not an option. | |
| Jan 2, 2012 at 19:33 | comment | added | Has QUIT--Anony-Mousse | Make sure you are accessing the same python version both times. | |
| Jan 2, 2012 at 19:26 | comment | added | user1069895 | Ah, got this: "ImportError: No module named numpy" I wonder if it's just a matter of restarting Apache? | |
| Jan 2, 2012 at 19:20 | history | answered | Dietrich Epp | CC BY-SA 3.0 |