idire Posted August 11, 2008 Share Posted August 11, 2008 I'm trying to use fsockopen to connect to an irc server. The script works fine when i load it via localhost, but when I attempt to run it on my host (godaddy) it times out. Presumably this is due to port being blocked. I have sent in a support ticket to the host about it. The irc server allows connections on ports: 6667, 6668, 6669, 7000, 8080 So I read up on it, and found something about using a proxy to connect via port 80 to the server. (something called socks?) but I have no idea how to implement this... my current code: <?php // Prevent PHP from stopping the script after 30 sec set_time_limit(0); // Opening the socket to the IRC network $socket = fsockopen("darklite.be.eu.swiftirc.net", 6667) or die(); ?> The error: Warning: fsockopen() [function.fsockopen]: unable to connect to darklite.be.eu.swiftirc.net:6667 (Connection timed out) Quote Link to comment Share on other sites More sharing options...
unkwntech Posted August 11, 2008 Share Posted August 11, 2008 First try an IP instead of the domain, if you need the potentially dynamic aspect of using the name then use gethostbyname() to get the IP. If i remember properly Godaddy wont allow you to use fsockopen, but try the above suggestion first. And with Godaddy it's usually better to call then submit a ticket. Quote Link to comment Share on other sites More sharing options...
idire Posted August 11, 2008 Author Share Posted August 11, 2008 First try an IP instead of the domain, if you need the potentially dynamic aspect of using the name then use gethostbyname() to get the IP. If i remember properly Godaddy wont allow you to use fsockopen, but try the above suggestion first. And with Godaddy it's usually better to call then submit a ticket. http://help.godaddy.com/article/287 I'll try with the ip now. EDIT: still times out But i'm now not sure if godaddy allows irc bots to be run, due to processor usage or something Quote Link to comment Share on other sites More sharing options...
tibberous Posted August 11, 2008 Share Posted August 11, 2008 Why don't you just switch hosts? You can get a VPS cheap enough. Quote Link to comment Share on other sites More sharing options...
idire Posted August 11, 2008 Author Share Posted August 11, 2008 Cant afford 30 a month for hosting atm, as its only a learning project. Nevermind i'll just do something else, cant host the bot on my home pc as the mysql server can only be accessed internally Quote Link to comment Share on other sites More sharing options...
tibberous Posted August 11, 2008 Share Posted August 11, 2008 You'll learn a lot more if you can get into your server. I'm paying $85 a month for a dedicated, just spent $600 for a server and $120 for hard drives - so I can then spend $200/mo to colocate it locally. Going to have 250/gig in RAID with dual, dual-core opterons @ 2.2, 4 gig DDR2, 10 meg burst, redundant power and Solaris 10 -- That's way better than godaddy. Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 You'll learn a lot more if you can get into your server. I'm paying $85 a month for a dedicated, just spent $600 for a server and $120 for hard drives - so I can then spend $200/mo to colocate it locally. Going to have 250/gig in RAID with dual, dual-core opterons @ 2.2, 4 gig DDR2, 10 meg burst, redundant power and Solaris 10 -- That's way better than godaddy. Also way more expensive. Congrats on the machine, but not everyone can justify/budget a dedicated server. Cant afford 30 a month for hosting atm, as its only a learning project. Nevermind i'll just do something else, cant host the bot on my home pc as the mysql server can only be accessed internally Most shared hosting providers will block IRC bots, even if they allow fsock. Attempting to get around this is a good way to get a whack on the head by a ban stick, or sometimes worse. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 Most shared hosting providers will block IRC bots, even if they allow fsock. Attempting to get around this is a good way to get a whack on the head by a ban stick, or sometimes worse. I think you mean the ban hammer. Much worse. Quote Link to comment Share on other sites More sharing options...
idire Posted August 11, 2008 Author Share Posted August 11, 2008 Yep their support got back to me irc = ban Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 Yep their support got back to me irc = ban I don't like GoDaddy. Quote Link to comment Share on other sites More sharing options...
idire Posted August 11, 2008 Author Share Posted August 11, 2008 They are cheap and their server is fast for me far better than my free one I used, cant speak for any other paid server as this was the first one i've used Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 They are cheap and their server is fast for me far better than my free one I used, cant speak for any other paid server as this was the first one i've used I think having no server is better than having a free server. And nearly every paid service is better than GoDaddy, it's just that GoDaddy can afford a Superbowl commercial. Check out http://www.bluehost.com and http://www.hostgator.com because I think that they're much better. Although optimally, you'd want a dedicated server, but that costs a decent amount of money, unless you create a lot of revenue from your site. Then it's worth it. xD Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 Good luck finding a shared hosting provider that will allow IRC bots, or bots of any kind for that matter. I love dreamhost... many bitch about them, but for shared hosting their flexibility and allowances are unmatched. As a test/dev server or something personal that doesn't need insane uptime ( I'd say they have times when they're 93-95% uptime, but usually around 99% ) they're perfect. I'm running my own build of PHP, MySQL can be accessed remotely, and you get complete/unlimited shell access/users. http://www.anhosting.com/ for anything else. Quote Link to comment Share on other sites More sharing options...
unkwntech Posted August 11, 2008 Share Posted August 11, 2008 BTW guys, if your paying $$$$$$ for dedicated boxes your paying to much... http://www.serverpronto.com Quote Link to comment Share on other sites More sharing options...
idire Posted August 11, 2008 Author Share Posted August 11, 2008 They are cheap and their server is fast for me far better than my free one I used, cant speak for any other paid server as this was the first one i've used I think having no server is better than having a free server. And nearly every paid service is better than GoDaddy, it's just that GoDaddy can afford a Superbowl commercial. Check out http://www.bluehost.com and http://www.hostgator.com because I think that they're much better. Although optimally, you'd want a dedicated server, but that costs a decent amount of money, unless you create a lot of revenue from your site. Then it's worth it. xD Whats wrong with godaddy? I'm not saying your wrong, i just dont know either way and i dont live in the us so wasnt affected by advertising, (found godaddy by web searching for a day and comparing) my main needs from the server are: speed, mysql speed and cron all of which godaddy does well. my site is for me to learn, but is also live with proper visitors, adsense records about 1500-2000 page impressions a day, and the internal stats page records about 55000+ page requests in last 7 days, and 1gp transfer. bought the server about a month ago Quote Link to comment Share on other sites More sharing options...
unkwntech Posted August 11, 2008 Share Posted August 11, 2008 Whats wrong with godaddy? Nothing, just the usual haters. Quote Link to comment 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.