Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
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

2 Answers 2

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

share|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? –  EEAA Jul 11 '11 at 1:45

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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