Problem of Calling OB with PHP

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem of Calling OB with PHP

Jie Shen
Dear all,

I am now trying to built a web-based calculation server. It will work like this:

Using PHP call the python script in linux.

The script could run well in the terminal of linux, but the same
commands can not run successfully under PHP calling (using

The error listed:

Traceback (most recent call last):
 File "/home/monkey/Monkey0.01/", line 137, in
 File "/home/monkey/Monkey0.01/", line 74, in main
  import getopt, string, readsdf
 File "/home/monkey/Monkey0.01/", line 33, in
  import pybel as pb
 File "/home/monkey/program/OB-2.2.3/lib/python2.6/site-packages/",
line 16, in
  import openbabel as ob
 File "/home/monkey/program/OB-2.2.3/lib/python2.6/site-packages/",
line 36, in
  _openbabel = swig_import_helper()
 File "/home/monkey/program/OB-2.2.3/lib/python2.6/site-packages/",
line 35, in swig_import_helper
  return _mod
UnboundLocalError: local variable '_mod' referenced before assignment

The calling line in PHP is: (attached is the php file)

/home/monkey/Monkey0.01/ -p '.$_POST['types'].' -s -1'.' -l
'.$_POST['classlabel'].' -i '.$uploadfile_train.' -o '.$ig_anal_out.'

BTW, this command can run successfully in the terminal after translation.
and we have exclude following reasons:
1. safe mode is already off
2. The shell command is right
3. there is no problem with "permission" issues.

I am grateful if anyone can help me.

Best regards,


Jie Shen

This Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
OpenBabel-discuss mailing list
[hidden email]

upload_basic.php (6K) Download Attachment