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?

link|improve this question

25% accept rate
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 1:37
feedback

2 Answers

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

link|improve this answer
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 1: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? – ErikA Jul 11 '11 at 1:45
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.