473,387 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with fsockopen()

Hi!

I have very big problem with fsockopen() function. It is very
important...

That's code:

<?php
$test = fsockopen ('chrome.pl', '8080');
?>

And that's result:

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

Warning: fsockopen() [function.fsockopen]: unable to connect to
chrome.pl:8080 (Unknown error) in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

I'm working on Linux Ubuntu 5.04 with Apache 2 (from package) and PHP5
(from package too).

I never use fsockopen(), so I'm absolutely "white"...

Please help me, the sooner the better, because script is very, very
important...

Best Regards,
Fipaj

Oct 11 '05 #1
9 18667
fi*******@gmail.com wrote:
Hi!

I have very big problem with fsockopen() function. It is very
important...

That's code:

<?php
$test = fsockopen ('chrome.pl', '8080');
?>

And that's result:

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

Warning: fsockopen() [function.fsockopen]: unable to connect to
chrome.pl:8080 (Unknown error) in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

I'm working on Linux Ubuntu 5.04 with Apache 2 (from package) and PHP5
(from package too).

I never use fsockopen(), so I'm absolutely "white"...

Please help me, the sooner the better, because script is very, very
important...

Best Regards,
Fipaj

Hi,
AFAIK the first parameter of the fsockopen function means the
target/host you want to connect to. Nonetheless in this case chrome.pl
is not a host. Due to this, the PHP interpreter ist not able to
establish a connection and you get the error. If chrome.pl is a host,
write it like http://www.chrome.pl.

best regards

Nico
Oct 11 '05 #2
fi*******@gmail.com wrote:
Hi!

I have very big problem with fsockopen() function. It is very
important...

That's code:

<?php
$test = fsockopen ('chrome.pl', '8080');
?>

And that's result:

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

Warning: fsockopen() [function.fsockopen]: unable to connect to
chrome.pl:8080 (Unknown error) in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

I'm working on Linux Ubuntu 5.04 with Apache 2 (from package) and PHP5
(from package too).

I never use fsockopen(), so I'm absolutely "white"...

Please help me, the sooner the better, because script is very, very
important...

Best Regards,
Fipaj


Fipaj,

FWIW,

telnet chrome.pl 8080

also fails. It seems port 8080 is not open on that server.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 11 '05 #3
Thanks for answers.

But I have one more problem.

Result of this script:
Warning: fsockopen() [function.fsockopen]: unable to connect to
http://chrome.pl:8080 (Unable to find the socket transport "http" - did
you forget to enable it when you configured PHP?) in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

"Unable to find the socket transport "http" - did you forget to enable
it when you configured PHP?" - I have PHP compiled from .deb package.
I edit php.ini, but there's no any conf options for fsockopen(). How to
"destroy" this error (:>) and run script?

Best regards,
Fipaj

Oct 12 '05 #4
fi*******@gmail.com wrote:
Thanks for answers.

But I have one more problem.

Result of this script:
Warning: fsockopen() [function.fsockopen]: unable to connect to
http://chrome.pl:8080 (Unable to find the socket transport "http" - did
you forget to enable it when you configured PHP?) in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

"Unable to find the socket transport "http" - did you forget to enable
it when you configured PHP?" - I have PHP compiled from .deb package.
I edit php.ini, but there's no any conf options for fsockopen(). How to
"destroy" this error (:>) and run script?

Best regards,
Fipaj

Hi,
I'm sorry, but I just noticed that I've made a mistake in my answer.
HTTP ist based on the TCP/IP protocol and it is forbidden to define
http://chrome.pl as host. Do you want to connect to the website
www.chrome.pl on port 8080? Then you only have to write www.chrome.pl as
host name in your script. If my assumption is wrong, please concretise
your question.

best regards,
nico
Oct 12 '05 #5
Thanks Nico.

But I'm not right, because I have some inner problem...

I need to connect with port 5222 (XMPP [jabber]), not 8080...

<?php
$test = fsockopen ('http://chrome.pl', '5222');
?>

But result is the same ;)

At the end, sorry for my bad English, I'm learning ;)

Best Regards,
Fipaj

Oct 12 '05 #6
<?php
$test = fsockopen ('http://chrome.pl', '5222');
?>


So nearly there... try this:

$test = fsockopen( 'chrome.pl', '5222' );
fwrite( $test, '<?xml version="1.0"?><stream:stream
xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"
to="nastysoft.com">' );
print fread( $test, 1024 );
fclose( $test );

Server returns:

<?xml version='1.0'?><stream:stream
xmlns:stream='http://etherx.jabber.org/streams' id='434D8128'
xmlns='jabber:client' from='nastysoft.com'>

Lookin' good...

---
Steve

Oct 12 '05 #7
Steve:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 5

Warning: fsockopen() [function.fsockopen]: unable to connect to
chrome.pl:5222 (Unknown error) in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 5

Warning: fwrite(): supplied argument is not a valid stream resource in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 8

Warning: fread(): supplied argument is not a valid stream resource in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 9

Warning: fclose(): supplied argument is not a valid stream resource in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php

I'm sure that something is wrong with my server/php configuration. But
what?

PS.

Script:
<?php
$fp = fsockopen("www.chrome.pl", 8080, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
}
?>

Result:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2

Warning: fsockopen() [function.fsockopen]: unable to connect to
www.chrome.pl:8080 (Unknown error) in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 2
(-1213682620)

Oct 13 '05 #8
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution in
/home/fipaj/serwer/works/jabber-php/class_jabber_php-0.4.2/test1.php on
line 5


Your DNS service is kaput. Substitute the IP...

$test = fsockopen('217.173.160.48', '5222'); // chrome.pl

---
Steve

Oct 13 '05 #9
Undeliverable ;)

Thanks for your help, Steve!
It works ;)

Oct 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Colin Bell | last post by:
I'm stuck on a problem with getting data from a XML data stream. This stream is large and trying to use fsockopen to get the stream down. I've tetsed the code by telneting into the machine/port...
2
by: Loopy | last post by:
I'm trying to write a script that will connect to an external site so that I can get access referer information in a database on another one of my sites. I got errors, so I tried to write a script...
6
by: murd | last post by:
Hi, I am trying to complete a post using fsockopen but I'm getting the following error: "Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? I am...
1
by: Syl | last post by:
Hi group - I have a database table with 4 columns that hold a url. I am selecting each url and I need to check to see if it is valid. I assumed I could use the fsockopen command. I've had to...
15
by: Bob Bedford | last post by:
Hi all, I'm having troubles with my hosting and for a few reasons I can't change. So here is my problem: I receive XML files with images included in the file. I've to parse the file, save datas...
8
by: Yoko | last post by:
So I am using php version 4.3.9 and lets say i have a file on the server called tester.php so i am using fsockopen to point to that file but it gives me a error below. $fh =...
4
by: keychain | last post by:
I'm experience the infamous "SSL: Fatal Protocol Error" bug with Apache 2.x According the fopen() documentation: "If you are using fsockopen() to create an ssl:// socket, you are responsible...
5
by: xieliwei | last post by:
I have a freshly installed openSuSe 10.2 with PHP4 from http://download.opensuse.org/repositories/home:/michal-m:/php4/openSUSE_10.2/ (openSuSe abandoned PHP4 since version 10, but I have customers...
6
by: henryrhenryr | last post by:
Hi I'm really hoping for some ideas! I have been setting up phpmailer on my server and it was working nicely on my local server so I uploaded to my live server and tested. The mystery is that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.