recently I'm doing a small project, and a part of it involves running a python script using PHP. to explain further:
Python:
from playsound import playsound
playsound("path/of/the/audio")
print("playsound executed")
PHP:
echo system('python3 pythonapp.py');
I used a print function to make sure my playsound func executed properly which it did, I even double checked my python file by running it directly in the terminal which plays the audio without any problem, what I would like to know, is why when I used PHP to call the python script it wont play the audio. but using phpmyadmin, the output "playsound executed" is shown.
Thank you for your time! hope you can help me resolve this.
Edit: Ubuntu is running on a Raspberry Pi 4B and I'm using phpmyadmin/apache2 to run my php script
paplay path/of/the/audio
. Also are you running in Ubuntu server or desktop?