Re: Configuring interfaces through php

From: Date: Tue, 23 Dec 2008 15:51:39 +0000
Subject: Re: Configuring interfaces through php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-285009@lists.php.net to get a copy of this message
On Tue, Dec 23, 2008 at 6:07 AM, Heysem Kaya <heysem.kaya@corelink.com.tr>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

« previous php.general (#285009) next »