RE: [exim] exim php shell_exec question

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Steffen Heil
Date:  
À: exim-users
Sujet: 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