728x90 exec2 PHP - shell_exec 함수 한글 경로 or 한글 인자가 깨지는 경우 urlencode() 사용 $arg = urlencode($arg); $data = shell_exec('python3 app.py ' . $arg); 출처: https://zxchsr.tistory.com/72 [PHP] 문자 인코딩 변환 iconv() / urlencode() ■ PHP 한글 깨짐 문자 인코딩 변환 ● iconv ( string $from_encoding , string $to_encoding , string $string ) ● urlencode(string $string) zxchsr.tistory.com 2023. 2. 18. PHP - shell_exec 함수로 파이썬 실행하고 한글이 안나오는 경우 putenv('PYTHONIOENCODING=utf-8'); 추가 putenv('PYTHONIOENCODING=utf-8'); $data = shell_exec('python3 app.py'); or $data = shell_exec('PYTHONIOENCODING=utf-8 python3 app.py'); 출처: https://trytoso.tistory.com/1543 php exec 사용하여 파이썬 호출후 한글이 안나올때 제목 그대로 아래와 같이 php 에서 파이썬 파일을 호출한다. 하지만 아래와 같은 오류가 계속 발생 Traceback (most recent call last): File "/home/naya/easyOCR-binary-centos-main/tests/php_client.py", .. 2023. 2. 18. 이전 1 다음 728x90