Python different behavour from comand line and php call -


i'm using small python 3.4 script works great when called comand line, throws exception when called php script. here's php code running python:

$cmd = 'python3 ./realty_parser_frontend.py'; $outputfile = 'log'; $pidfile = 'pid';  exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, $outputfile, $pidfile)); 

the exact error is:

unicodeencodeerror: 'ascii' codec can't encode characters in position 5-12: ordinal not in range(128) 

the thing don't error when running script directly , have no idea problem be...


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -