I have a python script which is used to remove noise from background of image. When I am calling this script from terminal it is working fine without any error. I am calling that script as below from terminal:
/usr/bin/python noise.py 1.png 100
But When I tried to calling it from PHP using apache it is giving me below error:
Traceback (most recent call last): File "./noise.py", line 2, in from PIL import Image, ImageFilter ImportError: No module named PIL
Can someone help me in resolving this issue? I tried to give permission to www-data user to that script, like this:
sudo chown www-data:www-data noise.py
But it doesn't help. Please help me.
Do
chmod +x noise.py
And call the Python script using full path like
system('/usr/bin/python SCRIPTFULLPATH/noise.py 1.png 100 2>&1' ,$op);
Try doing this
sudo chown www-data:www-data noise.py sudo chmod ugo+xrw noise.py sudo pip install --upgrade pip sudo service apache2 restart
Then after try refreshing again
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.