How to check ports are open or not in php?

I want to check which ports are enable or disable ports in php.

Starter Asked on January 7, 2018 in PHP.
Add Comment
1 Answer(s)

Finally i got solution for this question.

            $fp = fsockopen('', 25, $errno, $errstr, 5);
            if (!$fp) {
                        echo "port is closed or blocked";
            } else { 
                       echo "port is open and available";



Starter Answered on January 7, 2018.
Add Comment

Your Answer

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