5, September 2008

problem with the script - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  PHP Whois script (Moderator: Olaf)
Topic: problem with the script
« previous next »
Pages: [1] Print

Author Topic: problem with the script  (Read 2449 times)
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« on: Oct 18, 2006, 08:01:42 PM »

Hi,

I'm using the script for a while but after moving it to another server it doesn't work anymore...
When I check it says it's registered and if I select 'show all info i got following message'

[Querying whois.dns.be][whois.dns.be: Temporary failure in name resolution][Unable to connect to remote host]

I'm running it on a Linux server (php5), I've filled in linux in the class, if I change it...it doesn't work...

It's not a DNS problem on the server because I can do a nslookup on the server...

Do you have any suggestions?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Oct 18, 2006, 11:06:54 PM »

Hi,

I'm using the script for a while but after moving it to another server it doesn't work anymore...
When I check it says it's registered and if I select 'show all info i got following message'

[Querying whois.dns.be][whois.dns.be: Temporary failure in name resolution][Unable to connect to remote host]

I'm running it on a Linux server (php5), I've filled in linux in the class, if I change it...it doesn't work...

It's not a DNS problem on the server because I can do a nslookup on the server...

Do you have any suggestions?
do you tried the "win" option (is using fsockopen in place of the command line)


Last blog : Is your website is down? Know before your visitors do!
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #2 on: Oct 18, 2006, 11:09:36 PM »

yes i tried it...but that doesn't work
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Oct 18, 2006, 11:19:26 PM »

try a simple fsockopen command from the php manual and tell me if this is working...


Last blog : Is your website is down? Know before your visitors do!
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #4 on: Oct 19, 2006, 08:35:10 PM »

a simple psockopen didn't work so it's a problem with my server...but i don't know what to do to fix it :p wish me good luck lol
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Oct 19, 2006, 10:13:30 PM »

a simple psockopen didn't work so it's a problem with my server...but i don't know what to do to fix it :p wish me good luck lol
Check if you can use cURL


Last blog : Is your website is down? Know before your visitors do!
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #6 on: Oct 19, 2006, 10:32:17 PM »

I just tried "curl http://somedomain.com Visit through proxy" from the command line and i got the HTML code from that page so I guess it's working
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Oct 19, 2006, 10:49:49 PM »

I just tried "curl http://somedomain.com Visit through proxy" from the command line and i got the HTML code from that page so I guess it's working

hehe, curl is a complete Library, check if your server supports curl (via phpinfo())


Last blog : Is your website is down? Know before your visitors do!
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #8 on: Oct 19, 2006, 10:54:02 PM »

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Oct 19, 2006, 11:01:27 PM »

nothing wrong with this server:

try this code an tell me what you get:

Code:
<?php

// Use this simple function to get the "free" information (like "Not found")
// from a whois server. Read the (whois server) manual to learn which additional
// paramaters are used.

function get_whois_data($test_server$test_domain) {
$msg "";
$connection fsockopen($test_server43$errno$errstr10);
if (!$connection) {
$msg "Can't connect to the server!";
} else {
sleep(2);
fputs($connection$test_domain."\r\n"); 
while (!feof($connection)) {
$msg[] = fgets($connection4096);
}
fclose($connection);
}
return $msg;
}
print_r(get_whois_data("whois.nic.uk""finalwebsites.co.uk")); // test an existing domain
echo "<hr>";
//echo get_whois_data("whois.denic.de", "-T dn finalwebsites.de"); // test a non existing domain
?>



Last blog : Is your website is down? Know before your visitors do!
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #10 on: Oct 19, 2006, 11:15:34 PM »

Warning: fsockopen() [function.fsockopen]: unable to connect to whois.nic.uk:43 (Permission denied) in /var/www/vhosts/tomvandenberg.be/httpdocs/phpinfo.php on line 16
Can't connect to the server!

It has to be a problem with my webserver configuration...I have another server at the same location, using the same firewall,... (but a windows server) and there it's working...

http://www.heremanskeukens.be/test.php Visit through proxy -> working
http://www.tomvandenberg.be/phpinfo.php Visit through proxy -> not working
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #11 on: Oct 19, 2006, 11:18:51 PM »

you have to choices use a regular server Wink

or you have to wait until I have the time to write a cURL version for this class (need to work for customers first)


Last blog : Is your website is down? Know before your visitors do!
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #12 on: Oct 19, 2006, 11:23:32 PM »

It's a problem with the security...i never worked with fedora before and while installing the server i've installed 'selinux'...it's providing better security??? maybe my problem is that selinux is blocking the connection...if that doesn't fix my problem...i'm going to use the other server Smiley

I will keep you informed Smiley
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #13 on: Oct 19, 2006, 11:59:10 PM »

I fixed it Smiley

If you google on "fsockopen and selinux" you'll see that it's a known problem...

When using Red Hat Fedora, beware of Security Enhanced Linux, SELinux.

Quoted from Red Hat: "The security goal is to make sure that Apache HTTP is only reading the static Web content, and not doing anything else such as writing to the content, connecting to database sockets, reading user home directories, etc."

I fixed it by doing following:

[root@cypres init.d]# setsebool -P httpd_can_network_connect 1
[root@cypres init.d]# ./httpd restart
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: Oct 20, 2006, 12:15:31 AM »

cypres,

I'm a web developer not server admin Grin


Last blog : Is your website is down? Know before your visitors do!
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #15 on: Oct 20, 2006, 12:22:17 AM »

hehe Smiley i know but maybe other users could have the same problem so I just want to tell how I solved it...but i want to thank your your time Smiley (and the good script).
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #16 on: Oct 20, 2006, 12:23:28 AM »

hehe Smiley i know but maybe other users could have the same problem so I just want to tell how I solved it...but i want to thank your your time Smiley (and the good script).

right thanks for sharing the linux related information...


Last blog : Is your website is down? Know before your visitors do!
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4484
Tags : google apache databases dns linux Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  PHP Whois script (Moderator: Olaf)
Topic: problem with the script
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 05, 2008, 06:09:03 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.293
Total Topics: 7.476
Total Members: 3.899
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: speedy5044

25 Guests, 4 Users online :

13 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.