Questions tagged [fsockopen]

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

382 questions
2
votes
1 answer

How to fix fsockopen error?

Please help me to fix my code $fp = fsockopen("projecthoneypot.org/statistics.php", 80, $errno, $errstr, 5); if ($fp) { $url = "/"; fputs($fp, "GET $url HTTP/1.1\r\nHost: {projecthoneypot.org/statistics.php}\r\nConnection:…
Maroman
  • 316
  • 1
  • 5
  • 13
2
votes
1 answer

I need a litle help about fsockopen function

I need a little help with the fsockopen function. I have this PHP code: if (in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554,47830,50070)) || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 1)) I need to make…
X-Matrix
  • 33
  • 5
2
votes
1 answer

How to use Socks5 with fsockopen in PHP

I want to be able to connect to a remote host (e.g FTP, SMTP, POP) through Socks5 using fsockopen in PHP. Please how do I go about it?
user431949
  • 165
  • 1
  • 8
2
votes
1 answer

curl or fsockopen for paypal ipn

What advantages does one have over the other? Paypal recommends using fsockopen however there are many scripts on the internet which use curl. Which one shall I use? Curl:…
heymayne
  • 21
  • 2
2
votes
1 answer

Sessions in programmatically requested pages

After doing some research on this issue, I couldn't find any satisfying fix. The problem is: I'm performing a GET request programmatically. The request itself works fine and the requested page does so as well. I need to check for a valid login…
2
votes
1 answer

Setup a TCP listener in PHP

We're using a system at the moment that takes an incoming JSON request over TCP and responds using JSON too. Currently I've set up my socket like so in PHP: $socket = fsockopen($host, $port, $errno, $errstr, $timeout); if(!$socket) { …
ingh.am
  • 25,981
  • 43
  • 130
  • 177
2
votes
1 answer

PHP fwrite() to socket - operation not permitted?

I'm making a simple utility in PHP to control my Minecraft server via UDP: $fp = fsockopen('udp://host', 'port', $errno, $errstr); if (!$fp) error("Unable to connect!"); else { fwrite($fp, $data['command'].':user:pass'); …
oliverw92
  • 249
  • 1
  • 4
  • 10
2
votes
3 answers

How do I use fsockopen() to open a Telnet connection with a password?

I'd like to access a camera through it's Telnet capability. The problem is, it has Password-protection. This is no problem when doing it via Terminal, as I just use telnet 10.30.blah.blah then enter my password when prompted. But in php, I don't see…
AndyL
  • 1,615
  • 1
  • 13
  • 15
2
votes
0 answers

How to debug fsockopen?

How can I understand the error when trying to open a socket? I get error 0, however all SSL certificate works fine. $fp = fsockopen("ssl://cloud-messaging.bitrix24.com", 443, $errno, $errstr); if (!$fp) { echo "ERROR: $errno - $errstr
\n: "…
sk DYLAN
  • 61
  • 6
2
votes
2 answers

Error connecting through proxy in wordpress plugin via fsockopen

I'm using the stats plugin for wordpress which uses a core wordpress class IXR_Client in class-IXR. Although according to documentation it uses the proxy config found in wp-config.php I see no way it can as it uses the same address for host as it…
Rudiger
  • 6,749
  • 13
  • 51
  • 102
2
votes
1 answer

fsockopen https freezing on fgets

I attempting to connect to a server via PHP fsockopen to initially get a cookie for basic auth and then to persistently connect to a streaming server defined in the Location header of the response. The problem is that my code freezes on fgets and…
elkelk
  • 1,692
  • 2
  • 13
  • 20
2
votes
1 answer

PHP fsockopen() fails, but telnet works

I am trying to get Sphinx Search working under Windows7. So far everything is great except PHP cannot connect to the running service. ONLY TELNET WORKS: telnet localhost 3312 php: fsockopen("localhost", 3312, $errno, $errstr, 30); I decided to…
cornernote
  • 1,055
  • 1
  • 12
  • 20
2
votes
7 answers

PHP fsockopen() painfully slow

I'm using fsockopen() to call a number of connections in a list to see the online status of various ip/host and ports ... = 1) { $status = 'offline'; } else { $status =…
Phillip
  • 33
  • 1
  • 6
2
votes
1 answer

HTTP header "Content-type: multipart/mixed" causes "400 Bad request"

I'm trying to upload a file to a remote server using php's fsockopen. If my request looks like: $httpContent = [ "POST /index.php HTTP/1.1", "Host: The IP address of my remote server", "Connection: Close", …
Emil Avramov
  • 881
  • 5
  • 21
  • 38
2
votes
1 answer

Paypal IPN call - fsockopen timeout

Warning: fsockopen() [function.fsockopen]: unable to connect to www.paypal.com:443 (Connection timed out) This has worked previously? And suddenly has stopped working. Any ideas? This is the call: $fp = fsockopen ('www.paypal.com', 443,…
Rhyso
  • 696
  • 2
  • 9
  • 20