Php queries the local idle Port

Source: Internet
Author: User
Php queries the local idle Port php

I want to use php to write a file and return the local idle Port. how can this problem be achieved?


Reply to discussion (solution)

Netstat-

Netstat-
I want to write it on the php file, not just a command line.

What is the purpose of writing in php? How can php run on the server return the local port?

What is the purpose of writing in php? How can php run on the server return the local port?
A Cainiao. That is to say, it can be queried only in shell command lines?

Fsockopen: Try one port at a time.

Fsockopen: Try one port at a time.
Perfect. I just made it and I saw your answer. thank you!
The same idea!


Fsockopen: Try one port at a time.
Perfect. I just made it and I saw your answer. thank you!
The same idea! That is, the efficiency is a little low.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.