Re: Configuring interfaces through php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 23, 2008 at 6:07 AM, Heysem Kaya <heysem.kaya@xxxxxxxxxxxxxxx>wrote:

> Hi,
> I would like to configure the interfaces from a web page. What I should do
> is (AFAIK) writing reading /etc/network/interfaces and writing it. Rebooting
> networking after writing process.
>
> How can I do it in a practical way?


you can do this via the exec family of functions.

shell_exec('/etc/init.d/net.eth0 restart');

however, youll want to consider 3 things (at least),
1. the user the webserver is running as will need permission to do this.
that is best arranged via sudo.
2. giving the webserver user such permission increases your security risk on
that box
3. if the software fails to restart the interface, you might not get a
response back from the server ;)

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux