Questions tagged [fsockopen]

PHP function used to open (Internet or Unix domain) sockets connections.

382 questions
3
votes
2 answers

file_get_contents with https requests via proxy

How to do HTTPS requests via proxy server The proxy server is tinyproxy on debian code $context = stream_context_create([ 'http' => [ 'proxy' => 'tcp://xx.xx.xx.xx:8888', 'request_fulluri' => true ] ]); echo…
clarkk
  • 27,151
  • 72
  • 200
  • 340
3
votes
0 answers

Using fsockopen with UDP and proxy?

So I've been wondering (and testing), can I use fsockopen with proxy and UDP traffic? Cause for example this: $fp = fsockopen('udp://host.name.com', 512, $errno, $errstr); if(!$fp){ die($errno . ' - ' . $errstr); } works... but as soon as I add…
Beast
  • 31
  • 1
3
votes
2 answers

using php Download File From a given URL by passing username and password for http authentication

I need to download a text file using php code. The file is having http authentication. What procedure I should use for this. Should I use fsocketopen or curl or Is there any other way to do this? I am using fsocketopen but it does not seem to…
phpian
  • 901
  • 3
  • 13
  • 21
3
votes
4 answers

File resource persistence in PHP

I'm developing a simple chat web application based on the MSN protocol. The server communicates with the MSN server through a file resource returned from fsockopen (). The client accesses the server via XMLHttpRequest. The server initially logs in,…
Dr. Johnson
  • 579
  • 2
  • 6
  • 8
3
votes
2 answers

Upload a file to Google Code Hosting with PHP and fsockopen()

Google Code Hosting has the ability to upload files to it remotely. I've been trying to program a script in PHP which uploads files to my account. Here's the script itself:
Tower
  • 98,741
  • 129
  • 357
  • 507
3
votes
4 answers

PayPal IPN Updates to Accommodate HTTP1.1 - Connection reset by peer

We have been working to update our PayPal IPN scripts in accord with seom recent changes. Here is the instruction in part by PayPal ... Your Action Required before February 1, 2013 You will need to update your IPN and/or PDT scripts to use HTTP…
flamegri11ed
  • 53
  • 2
  • 8
3
votes
1 answer

fsockopen not working whit FastCGI (PHP)

I have a php question about fsockopen Server: VPS CentOS 6.3 (Final) PLESK 11 Problem: If i use FastCGI the function fsockopen is not working. I get: Warning: fsockopen(): unable to connect to xx.xx.xx.xx:80 (Permission denied) If i edit the…
Mike
  • 51
  • 1
  • 5
3
votes
1 answer

fsockopen blocked on ports 25&587

I have a very simple snippet of code which connects to a SMTP server using fsockopen (or alternatively stream_socket-client) that looks like this:
3
votes
3 answers

PHP function fsockopen never returning false

Could somebody help me with the php function fsockopen? if I call the function like this : $fp = fsockopen('xywqnda.com', 80, $errno, $errstr, 10); With an unavailable host domain, it will never return false and I don't understand why!
3
votes
2 answers

PHP fetch page's content with remote call

Ok, so what I am looking for is somewhat similar like the code below which is very dummy and not working for some reason which I totally don't care about now (please read the question under the code!!): $url = urldecode($_GET["link"]); $port =…
benqus
  • 1,119
  • 2
  • 10
  • 24
2
votes
2 answers

Is fsockopen generally slow?

I am trying to perform a downstream bandwidth speed test in PHP. I dunno why wget would download 1 Mbyte data in 400 Mbps while fsockopen does it in 170 Mbps. I am using fsockopen since it is supported on all servers. Does any one know why? 400 Mbps…
tim
  • 2,530
  • 3
  • 26
  • 45
2
votes
1 answer

fsockopen does not always perform the mysql queries when page is refreshed

Server A uses fsockopen, fwrite, and fgets to collect information from remote server B. Remote server B creates mysql queries and provides this info. When server A first loads, all the information (from remote server B) appears on server A - meaning…
YWSW
  • 453
  • 8
  • 18
2
votes
2 answers

fsockopen inside php to a remote server, what IP will the remote server get?

Background : My apache webserver runs on two virtual host with two different IP address. I have whitelisted both of these IPs to the remote SMPP server/system. I would be communicating to the remote server from a single machine which has these two…
wadkar
  • 960
  • 2
  • 15
  • 29
2
votes
1 answer

fsockopen demo at localhost

Can anybody help me to sort out fsockopen issue in localhost. I created fsock.php to post a variable to test121.php in the same folder. http://localhost/ftp/fsock.php
chandoo
  • 1,276
  • 2
  • 21
  • 32
2
votes
2 answers

fsockopen have errors : HTTP/1.1 301 Moved Permanently and 404

I have used this code to open whatismyipaddress.com $fp = fsockopen("whatismyipaddress.com", 80, $errno, $errstr, 5); if ($fp) { $url = "/"; fputs($fp, "GET $url HTTP/1.1\r\nHost: {whatismyipaddress.com}\r\nConnection: close\r\n\r\n"); …
Maroman
  • 316
  • 1
  • 5
  • 13