Does PHP/Apache fully support IPv6?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Johnny

    Does PHP/Apache fully support IPv6?

    Now I am running PHP in Apache on Windows platform, but I need to
    migrate it into linux and using IPv6 instead. So I want to know if PHP
    fully support IPv6. And how about the workload of this migration?

    Thanks for your help.
  • Johnny

    #2
    Re: Does PHP/Apache fully support IPv6?

    guanglei_li@yah oo.com (Johnny) wrote in message news:<9fb457cb. 0310300048.5a1c c3af@posting.go ogle.com>...[color=blue]
    > Now I am running PHP in Apache on Windows platform, but I need to
    > migrate it into linux and using IPv6 instead. So I want to know if PHP
    > fully support IPv6. And how about the workload of this migration?
    >
    > Thanks for your help.[/color]

    I read the documents of apache on RH9, and found that apache currently
    can fully support IPv6, but how about PHP?

    Comment

    • Eto Demerzel

      #3
      Re: Does PHP/Apache fully support IPv6?

      In article <9fb457cb.03103 01859.28df1dc4@ posting.google. com>, Johnny's
      output was...[color=blue]
      >
      > I read the documents of apache on RH9, and found that apache currently
      > can fully support IPv6, but how about PHP?
      >[/color]

      Searches haven't turned up much, but:

      at http://uk.php.net/gethostbyaddr

      Somebody called Abe has posted this:

      gethostbyaddr() doesn't seem to be able to resolve ip6.int
      (ipv6) adresses, so I made a function that can, and works
      just like the normal gethostbyaddr() .

      You need dig and ipv6calc, dig should come with most
      distributions, if not, install bind from http://www.isc.org.
      ipv6calc can be found at
      http://www.bieringer.de/linux/IPv6/ipv6calc/index.html.

      function gethostbyaddr6( $ip6) {
      $ipv6calc = "/bin/ipv6calc";
      $dig = "/usr/bin/dig";
      $file = popen($ipv6calc ." --in ipv6addr --out revnibbles.int
      ".escapeshellar g($ip6), r);
      $ip = fread($file, 128);
      pclose($file);
      if ((substr($ip, 0, 5) == "Error") || (!$ip)) return "Address is not a
      valid IPv6 address";
      $file = popen($dig." ptr ".$ip, r);
      while (!feof ($file)) {
      $buffer = fgets($file, 128);
      if (substr($buffer , 0, 1) == ";") continue;
      $buffer = explode(" ", $buffer);
      if ($buffer[3] == "PTR") {
      $host = substr(trim($bu ffer[4]), 0, -1);
      pclose($file);
      return $host;
      }
      }
      pclose($file);
      return $ip6;
      }

      echo gethostbyaddr6( $_SERVER[REMOTE_ADDR]);

      Comment

      Working...