Page 1 of 1

Possibility to manage Layer 2 Switch ports with PHP

Posted: Mon Nov 03, 2008 3:21 pm
by Pethlehemm
I'm not sure that this goes to right place but I try nevertheless.

What I would like to know is that, is it possible to control Layer 2 Switch ports using PHP through SNMPv2? The idea is to turn ports on/off through web application. Like I said, I am not even sure that this is possible but any idea would be welcomed.

Re: Possibility to manage Layer 2 Switch ports with PHP

Posted: Mon Nov 03, 2008 4:27 pm
by infolock
Think about this way: if you can do it in terminal mode on the server where PHP is installed, then yes.

Are there build-in PHP functions to manage a router? no.

Concrete Answer: Do it on the terminal, then use backticks (`) or shell_exec to issue the connection/commands.

Re: Possibility to manage Layer 2 Switch ports with PHP

Posted: Tue Nov 04, 2008 5:26 am
by Pethlehemm
OK. But this isn't actually a web application, is it? Like I understand, there is no way to create layer2 switch controller using only PHP and which works through web? Can anyone say what are other possibilities?

Re: Possibility to manage Layer 2 Switch ports with PHP

Posted: Wed Nov 05, 2008 4:00 pm
by infolock
I'm not sure what else you want. If you can issue a command via terminal, you can issue it with PHP. And that means you can either make this a command line php utility or turn it into a web-based application.