0

I use Windows 7 and my idea is to connect 4 GSM modems to my Windows 7. I would like to run 4 PHP scripts on these 4 different IPs from each modem.

ex:

  • script1.php is seen as IP assigned from modem1

  • script2.php is seen as IP assigned from modem2

  • script3.php is seen as IP assigned from modem3

  • script4.php is seen as IP assigned from modem4

and all scripts running at the same time.

Any idea how to do that ?

0

1 Answer 1

0

@Giacomo1968 in his comment is correct in his rough approach. There are some things you need to realise to understand how to solve the problem -

  • PHP is not a web server, its interpreted code which runs on a web server.
  • The webserver is what is bound to an IP address (or multiple addresses)
  • You need to sort out the routing and IP addressing before you can get the PHP side of things working. This is likely to be the hardest part if it involves source routing (which is probable if you are using multiple cell providers or your provider uses Reverse Path Filtering in their network.

It would not be appropriate to go through the details here, however to solve each part of the problem:

  1. Bind the IP addresses given to each modem to the computer. Then use Policy Routing (Source based routing) to route as appropriate. (I can advise how to do this on Linux, but not Windows).
  2. If your cellphones have static IP addresses, great. If not you will need to work out a solution for dynamic DNS.
  3. Set up a web server - Apache is a good choice. Look up VirtualHosts and create separate virtualhosts for each IP address. If you have static IP addresses you can use those, otherwise you will need to use Name Based virtualhosts tied in to the dynamic DNS names.
  4. Make sure that each virtualhost points to the same place to get its documents from (or put each scriptX.php in a different location

I do wonder though what you are trying to do here. If, for example, you are trying to set up a web to SMS gateway or similar that will work with multiple providers you have asked entirely the wrong question ! Similarly if you are trying to spread load across multiple cellphone connections for incoming traffic you have asked the wrong question.

3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .