rembg icon indicating copy to clipboard operation
rembg copied to clipboard

How to run from PHP ? i tried no success[FEATURE] ...

Open bil80 opened this issue 3 years ago • 2 comments

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'

bil80 avatar Sep 08 '22 05:09 bil80

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/'

bil80 avatar Sep 09 '22 06:09 bil80

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 10 '22 02:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 24 '22 02:10 github-actions[bot]

@bil80 I tried your approach but it's not working.

souravjamwal77 avatar Oct 26 '22 13:10 souravjamwal77