Answer the question
In order to leave comments, you need to log in
Why is Apache2 doing exec() strangely?
Good evening gentlemen!
The point is this: for myself I write a Web-control panel for the laptop. It has Apache2, mod_python. I don’t look into the external network - I don’t bother with security. As a result, I got something like this :
Commands are executed by PHP by GET key, via system(). For example:
<?php
if ($_GET["bright"] == "increace") {
exec('SBLM -up');
if ($_GET["mocp"] == "prev") {
system('mocp -G');
echo "Comlete";
Answer the question
In order to leave comments, you need to log in
If apache is running from www-data, then most likely it does not have enough rights to access devices / sockets or something like that. Try to run as your user. To do this, in /etc/apache2/envvars you need to change the values
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question