Hi I have a piece of code that execute python3 command from php file:
shell_exec('python3 /var/www/html/PlantDiseaseSystem/src/lib/py/riskcalc.py '.$riskValue[0].','.$riskValue[1].','.$riskValue[2].','.$riskValue[3]);
It works just fine and give me the right result. But once I run the same php file from apache server using Javascript Post request, it won't work! I checked my apache2 error log and shows below message:
Traceback (most recent call last):
File "/var/www/html/PlantDiseaseSystem/src/lib/py/riskcalc.py", line 10, in <module>
from osgeo import gdal
File "/usr/lib/python3/dist-packages/osgeo/__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "/usr/lib/python3/dist-packages/osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "/usr/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: /usr/lib/python3/dist-packages/osgeo/_gdal.cpython-35m-x86_64-linux-gnu.so: undefined symbol: VSICurlClearCache
It seems to me I'm having trouble import a library, how come I could do it just fine from shell? I'm using Ubuntu 16.04. Thanks!