Cant Use Fopen
Aug 2, 2009i have a vps, and have a problem with fopen(a function php).
When i turn on iptables, i cant use fopen funtion.
here is my iptables rules
Code:
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
Allow returning packets
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Allow incoming traffic on ports 80 and 443 for web server
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 10000 -j ACCEPT
-A INPUT -p tcp --dport 21 -j ACCEPT
Allow local traffic
-A INPUT -i lo -j ACCEPT
Allow ping
-A INPUT -p icmp --icmp-type 8 -j ACCEPT
Allow incoming SSH
-A INPUT -p tcp --dport 2200 -j ACCEPT
-A OUTPUT -d 72.233.69.3 -j ACCEPT
-A OUTPUT -d 72.233.69.2 -j ACCEPT
-A OUTPUT -d 66.135.58.62 -j ACCEPT
-A OUTPUT -d 66.135.58.61 -j ACCEPT
-A OUTPUT -d rest.akismet.com -j ACCEPT
-A OUTPUT -d api_key.rest.akismet.com -j ACCEPT
-A INPUT -s 127.0.0.1 -j ACCEPT
Ban ip
-A INPUT -s 213.152.242.28 -j DROP
COMMIT
and my php code
Code:
<?php
$handle = fopen("http://www.google.com/", "r");
if (!$handle) {
print "fopen doesn't work";
} else {
print "fopen seems to work";
}
?>