Zum Inhalt springen

Forum

PHPWelt.net Blog - Ein weiteres tolles WordPress-Blog


fsockopen error 22 unable to connect / invalid argument

Wenn folgender Code:

<?php
$fp = fsockopen('localhost', 80, $errno, $errstr);
if (!$fp) {
  print("ERROR Number: ".$errno. '<br>Error String: '. $errstr);
} else {
  echo 'fsockopen() ok';
  fclose($fp);
}
?>

ausgibt:

Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:80 (Invalid argument) in /(…)/fsocktest.php on line 3
ERROR Number: 22
Error String: Invalid argument

dann muss in die /etc/network/interfaces.template folgendes:

auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
broadcast 127.255.255.255
up ip route replace 127.0.0.0/8 dev lo

danach reboot.

« really static – wordpressplugin – really-static 0.21 Wordpress Plugin »

Info:
fsockopen error 22 unable to connect / invalid argument ist Beitrag Nr. 132
Author:
Category:
Linux |
Tags:
 

No Comments »

No comments yet.

Leave a comment