rembg
rembg copied to clipboard
How to run from PHP ? i tried no success[FEATURE] ...
Hello,
In my linux server, rembg works fine from ssh command line, but when i try to run the same command line from my php script, the output is not generated. I configured my server to run the php with root permission via the www-data user. I already have other program that it run from php script with full permission without any issue.
I think for rembg we have to set the full path of each python files somewhere, i am not sure. Does anyone have an idea?
For my php i use this simple command:
exec("/usr/local/bin/rembg i /var/www/clients/client0/web1/web/test/test.jpg /var/www/clients/client0/web1/web/test/output.png 2>&1");
And this is the error:
RuntimeError: cannot cache function '_make_tree': no locator available for file '/usr/local/lib/python3.9/site-packages/pymatting/util/kdtree.py'
I fixed the error, for those who get the same bug, i had to add this in kdtree.py file:
import os
os.environ[ 'NUMBA_CACHE_DIR' ] = '/tmp/'
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
@bil80 I tried your approach but it's not working.