You'll need to set the STAF environment variables. Perhaps you can write
a PHP function that sets up the correct environment and then invokes the
Python script.
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From: bab mis <bab...@outlook.com>
To: "staf-users@lists.sourceforge.net"
<staf-users@lists.sourceforge.net>
Date: 07/25/2014 03:26 PM
Subject: [staf-users] How can i use PySTAF in a python file ,
called by web page
My php webpage calls a python script demo.py which imports PySTAF , Since
the webpage is called with nologin shell the env variables set in profile
file are not reflecting for the page, hence it throws importerror
exception . How can i overcome this issue??
Traceback (most recent call last):
File "/opt/lampp/htdocs/demo.py", line 10, in
from PySTAF import *
File "/usr/local/staf/lib/PySTAF.py", line 9, in
import PYSTAF
ImportError: libSTAF.so: cannot open shared object file: No such file or
directory
Note: The Python script works properly when called from the command prompt
, where as fails when called from web.
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users