I created execute.php as follows
Code:
<?php
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w"), // stderr
);
$process=proc_open('/bin/irsend list "" ""',$descriptorspec,$pipes,dirname(__FILE__), null);
if(is_resource($process))
{
fwrite($pipes[0],"");
fclose($pipes[0]);
$stdout=stream_get_contents($pipes[1]);
fclose($pipes[1]);
$stderr=stream_get_contents($pipes[2]);
fclose($pipes[2]);
$return_value = proc_close($process);
}
print "[".$stderr."]";
?>
from the command line it works fine
Code:
# php execute.php
[irsend: Philips_DVDR3570H_audio
irsend: RC-897
irsend: RC-896
irsend: amp
irsend: Denon_RC-846
irsend: DENON
irsend: denon_rc841
irsend: Denon_RC-840
irsend: RC-830
irsend: Philips_DVDR3570H
irsend: PHILIPS_RC2034302
irsend: dvd712
irsend: Philips_DVD-724
irsend: Philips_DVD711
irsend: Samsung_BN59-00940A
]
over the web it gave the error
Code:
irsend:access denied
looking around I tried the following to fix it.
Code:
chcon -u system_u -r object_r -t httpd_sys_script_exec_t /bin/irsend
now I get the following
Code:
[irsend: could not connect to socket irsend: Permission denied ]
I think it has to do with selinux. I'd like to leave selinux enabled but I can't find good documentation on how to do it.