Jump to content

Changing IP address via php?


schris403

Recommended Posts

Does anyone know if it is possible to actually change an IP address on a system via php? I have been trying different things for days and can't seem to get it to work. I know I can call ifconfig via php via system("ifconfig"); and I have safe mode turned off to make this work. I will eventually put a safe_mode_exec_dir in my php.ini with ifconfig in there but really could use some help writing this first... Basically I want a page where it will first read the current IP values from the system (ip address, netmask, gateway, dns servers) to populate fields where I can change them and then submit the changes back via ifconfig & route commands.

 

Any help would be GREATLY appreciated.

 

Thanks!

Chris

Link to comment
Share on other sites

visit your routers IP in your browser

You are confused. The post is not about modifying a routers configuration but the IP address of a physical machine.

 

If you want to change the server settings remotely use PUTTY. You do not need PHP to do this.

 

Exactly. How do you think I changed my servers IP to a static, I visited my browsers IP address, selected my machine, chose the correct IP, and changed it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.