RE: [exim] exim php shell_exec question

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Steffen Heil
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: RE: [exim] exim php shell_exec question
Hi

> $mailqueue = shell_exec("exim -bpc");
> exim: permission denied
> Any ideas how I could get round this?


A way around this would be:
install sudo, write the command above to a script, set root execution rights
for the script to everyone, call "sudo script" from php.

But I am not really sure, you wanna do this.
Do you really think it is a good idea to have a web server execute something
as root?

Another way would be to have a cron job that outlput the needed information
into a file and you read this file from php.

Advantages:
- more secure
- less cpu time needed with many page hits

Disadvantages:
- more cpu time needed with few page hits
- no current value, updated only after some time

Regards,
Steffen