Home > Backend Development > PHP Tutorial > php 查询本机空闲端口

php 查询本机空闲端口

WBOY
Release: 2016-06-23 14:21:19
Original
1031 people have browsed it

php

   我想用php写一个文件返回本机的空闲端口,怎么实现?

回复讨论(解决方案)

netstat -an

netstat -an
我是要写在php文件上的,不是单单的命令行啊

写在 php 里有什么用?php 在服务器上运行,怎么能返回本机的端口?

写在 php 里有什么用?php 在服务器上运行,怎么能返回本机的端口?
菜鸟一枚,,,所以求教大神。就是说只有在shell命令行才能查询?

fsockopen,一个一个端口去尝试。

fsockopen,一个一个端口去尝试。
perfect,我刚做出来就看见你的答案了,谢谢啦!
都是一样思路!


fsockopen,一个一个端口去尝试。
perfect,我刚做出来就看见你的答案了,谢谢啦!
都是一样思路! 就是效率有点低哈。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template