I've been working on a project for school and have been running into some trouble with PHP running python scripts. When I run this specific python script in terminal it works perfectly; however, when I run it through PHP's shell_exec the script fails to display anything. I believe it may be due to captionbot, but I am not sure what the problem really is. (Also when I change my python script to something simple like print("hello") it works fine)
Here is the PHP Code
echo exec("python /var/www/html/caption.py 'https://www.guidedogs.org/wp-content/uploads/2017/04/small-boxes-website2.jpg'");
?>
Here is the python script
#!/usr/bin/env python
import sys
people = sys.argv[1]
from captionbot import CaptionBot
c = CaptionBot()
desc = c.url_caption(people)
print(desc)