If i run lpr from root, or even run from apache
runuser -l apache -c 'lpr -P RICOH_Aficio_2032 -r /var/www/html/website/tmp/test.txt'
works like a charm.
However, when i print using php_exec
exec('lpr -P RICOH_Aficio_2032 -r /var/www/html/website/tmp/test.txt 2> /var/www/html/website/tmp/error.txt');
i get the following error
lpr: Permission denied
I even set apache as the owner of test.txt
Php exec works when i use ls, cat ecc. But lpr and lpstat don't work.
What's wrong?
Note: i'm on Centos 6.8 with php 5.6