Blog Home Dudermang

Play a sound on your server when a website/script is loaded.

by Corey Faulkerson

Posted on 2016-10-21 01:48:06

play a music file directly on a server when a url is loaded using php and python.


echo shell_exec("sudo python /var/www/html/");

pyton file called

print('hello world1')
import subprocess['aplay -fdat /var/www/html/sounds/chaching.wav'], shell=True)
print('hello world2')

need to chmod python script
chmod 777 /var/www/html/

and it should play the sound when you load the php file.


music, sound, local, linux, php, script, execute, launch