14, February 2012

problem with the script - webmaster forum

 
Webdigity webmaster forums
[ 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 4009 times)
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« on: Oct 18, 2006, 07: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Oct 18, 2006, 10: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 : A new Wordpress theme for our blog
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #2 on: Oct 18, 2006, 10:09:36 pm »

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


It's time to use PHP5!


« Reply #3 on: Oct 18, 2006, 10:19:26 pm »

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


Last blog : A new Wordpress theme for our blog
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #4 on: Oct 19, 2006, 07: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Oct 19, 2006, 09: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 : A new Wordpress theme for our blog
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #6 on: Oct 19, 2006, 09:32:17 pm »

I just tried "curl http://somedomain.com" 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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Oct 19, 2006, 09:49:49 pm »

I just tried "curl http://somedomain.com" 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 : A new Wordpress theme for our blog
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #8 on: Oct 19, 2006, 09:54:02 pm »

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


It's time to use PHP5!


« Reply #9 on: Oct 19, 2006, 10: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 : A new Wordpress theme for our blog
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #10 on: Oct 19, 2006, 10: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 -> working
http://www.tomvandenberg.be/phpinfo.php -> not working
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #11 on: Oct 19, 2006, 10: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 : A new Wordpress theme for our blog
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #12 on: Oct 19, 2006, 10: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, 10: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: Oct 19, 2006, 11:15:31 pm »

cypres,

I'm a web developer not server admin Grin


Last blog : A new Wordpress theme for our blog
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #15 on: Oct 19, 2006, 11:22:17 pm »

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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #16 on: Oct 19, 2006, 11:23:28 pm »

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 : A new Wordpress theme for our blog
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....

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?
Feb 14, 2012, 08:37: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!






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