Hi, all.
please help me with this problem.

I want to run snort through a web application with exec("snort -v -i eth0 ") php function.
for example when start button was pressed snort should be run,
but the execution failed with this error:

Running in packet dump mode

--== Initializing Snort ==--
Initializing Output Plugins!
Verifying Preprocessor Configurations!

Initializing Network Interface eth0
ERROR: OpenPcap() device eth0 open:
socket: Operation not permitted
Fatal Error, Quitting..

but when I run snort command via command line as root it will execute successfully.

I think this problem is for that apache user haven't access to network adapter, is my guess correct? I have no experience with apache, should I change apache configuration? what is the configuration for this problem.

I apply below command:

chown -R wwwrun:www /srv/www/htdocs/myprogram/snort

and changed my snort run command like this:

exec(/srv/www/htdocs/mywebprogram/snort/bin/snort -u wwwrun -g www -v -i eth0)

but my problem didn't solve,I also test this:

chown -R root:www /srv/www/htdocs/mywebprogram/snort

but no difference,
I think I should find a way to allow apache to access but I don't know how?