rittwickbanerjee Posted July 27, 2008 Share Posted July 27, 2008 Hi Friends, I was thinking that after a application ends completely if I would be able to Close/Block the default/Non-default port using php? but I am unable to do that, can anyone help make this? Thank you Rittwick Banerjee Quote Link to comment https://forums.phpfreaks.com/topic/116798-how-to-closeblock-the-default-port-in-php/ Share on other sites More sharing options...
trq Posted July 27, 2008 Share Posted July 27, 2008 Ports can be closed easily on linux using iptables which can easily be accessed via exec. If you close the port your http server is listening on however you will no longer be able to make requests to the http server. You might want to go into more detail about what exactly it is your trying to do and also why you think you need to do it. Quote Link to comment https://forums.phpfreaks.com/topic/116798-how-to-closeblock-the-default-port-in-php/#findComment-600690 Share on other sites More sharing options...
rittwickbanerjee Posted July 27, 2008 Author Share Posted July 27, 2008 No, Actually I was intranet where I was trying to close/block the port on which http server listening after the application ends. so, is there any code or function to do this? Please help me Quote Link to comment https://forums.phpfreaks.com/topic/116798-how-to-closeblock-the-default-port-in-php/#findComment-600778 Share on other sites More sharing options...
trq Posted July 27, 2008 Share Posted July 27, 2008 <?php exec('/usr/bin/iptables -A INPUT -j DROP -p tcp --destination-port 80'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/116798-how-to-closeblock-the-default-port-in-php/#findComment-600809 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.