python script executed from php gives error -
on debian run xampp. want execute python script using php shell_exec. php code:
shell_exec("/opt/lampp/htdocs/news/hello.py 2>1 &");
when run browser error:
/usr/bin/python: /opt/lampp/lib/libz.so.1: no version information available (required /usr/bin/python)
if run terminal window using this: php /opt/lampp/htdocs/page/index.php
works without problems. ideas how can make work browser? thanks
i'm guessing xampp comes it's own libraries instead of using system libraries, , means it's setting ld_library_path
it's local library directory.
this cause other programs started php use libraries, may not compatible with.
to veryfy that, try system("env");
, sould show exported environment variables. if ld_library_path
set, use:
shell_exec("ld_library_path= /opt/lampp/htdocs/news/hello.py 2>1 &");
that unsets before running python script.