This is my php code :
$output = shell_exec("python3 test.py");
echo $output;
This is my python code
#!/usr/bin/env python3
import requests
import sys
print("Hello from Python")
it show text Hello from Python when accessed from browser and also terminal using php test.php
When I change my python code to include import mysql.connector
#!/usr/bin/env python3
import requests
import mysql.connector
import sys
print("Hello from Python")
it show text Hello from Python when accessed from terminal using php test.php but not showing anything when accessed using my browser, why?