I am running apache with php5 on mac OS X. My application requires the ability to enable a user to change the IP address of the server through a web interface. Is there a slick method that can use PHP to shell_exec to the OS X system to modifiy the IP address?
I tried using IFCONFIG, but it gave a permission denied reponse.
<?php
//get new ip address
$newip = $_GET['newip'];
//Build a command to change the IP address
$command = "ifconfig en0 $newip";
//shell to some function in OS X
$response = shell_exec($command);
?>
I tried using IFCONFIG, but it gave a permission denied reponse.
<?php
//get new ip address
$newip = $_GET['newip'];
//Build a command to change the IP address
$command = "ifconfig en0 $newip";
//shell to some function in OS X
$response = shell_exec($command);
?>