CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Can't run perl script from browser; 500 internal server error

 



mracine923
New User

May 19, 2013, 4:59 PM

Post #1 of 4 (403 views)
Can't run perl script from browser; 500 internal server error Can't Post

I have a simple perl script to play a sound file...

#!/usr/bin/perl

# file: system.pl
system "aplay police_s.wav";


it runs just fine when I run it from the terminal but I can't get it to run by entering the browser location. I'm new to perl and I can get my other scripts to run but this one script keeps getting a 500 internal server error when I try to run it from a browser. I'm stuck!


mracine923
New User

May 19, 2013, 5:22 PM

Post #2 of 4 (401 views)
Re: [mracine923] Can't run perl script from browser; 500 internal server error [In reply to] Can't Post

by the way, here's the error log

Code
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib confmisc.c:768:(parse_card)  
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] cannot find card '0'
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139]
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib conf.c:4241:(_snd_config_evaluate)
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] function snd_func_card_driver returned error: No such file or directory
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139]
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib confmisc.c:392:(snd_func_concat)
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] error evaluating strings
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139]
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib conf.c:4241:(_snd_config_evaluate)
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] function snd_func_concat returned error: No such file or directory
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139]
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] aplay: main:682: audio open error: No such file or directory
[Sun May 19 20:18:07 2013] [error] [client 192.168.1.139] File does not exist: /var/www/favicon.ico



wickedxter
User

May 19, 2013, 9:11 PM

Post #3 of 4 (389 views)
Re: [mracine923] Can't run perl script from browser; 500 internal server error [In reply to] Can't Post

thats because ur useing a system call to play a .wav file thru the web server then thru to the broswer which wont work that way as u have noticed. ull need some sorta music player thats web based thats accepts that type to play it.


mracine923
New User

May 19, 2013, 9:17 PM

Post #4 of 4 (387 views)
Re: [wickedxter] Can't run perl script from browser; 500 internal server error [In reply to] Can't Post

forgive me if I don't understand, but I'm not trying to play the sound file through the browser. I'm trying to have the browser command kick off the sound file on the actual server. Let me explain the end goal...

I have a raspberry pi setup with a webserver and I have another device (an ISY) that controls all of my lighting and security. What I'm trying to do is have the ISY send a browser command to the raspberry pi when a device triggers the command. The raspberry pi is hooked up to some speakers and will play the sound file when the browser command is triggered. Does that make sense?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives