0

I'm trying to enable a few ports, as I have a php script that uses sockets.

I added the following to my httpd.conf file:

Listen 6112
Listen 6113

However, when I execute my php script, it says the ports are already in use. How can I go by using those ports for my script?

Spencer
  • 23
  • 3
  • 1
    Are you trying to listen to those ports with PHP directly? If so, then you probably shouldn't be setting Apache to listen to those ports. Please be more specific about what you are trying to do. – Zoredache Jul 11 '11 at 01:37

2 Answers2

1

If you put those two Listen directives in your httpd.conf, then apache will bind those ports, making them unavailable to your php scripts.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • Then how can I go by opening the ports? I've tried iptables, but I couldn't get that working. – Spencer Jul 11 '11 at 01:14
  • After removing those `Listen` lines from your apache config, what errors are you getting when attempting to bind those ports? Have you run the `netstat` command recommended by another answerer? – EEAA Jul 11 '11 at 01:45
0

The "netstat -l -p" (without the quotes) command will list out the currently active listening ports.

user48838
  • 7,431
  • 2
  • 18
  • 14