A
A
Alexey2014-10-17 14:34:18
Apache HTTP Server
Alexey, 2014-10-17 14:34:18

Why can't I update/install language packs?

DigitalOcean - Ubuntu - vesta panel - wordpress 4.0 (same story with 4.1 dev)
When installing plugins or when updating languages, a message pops up:

PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

The plugin or template itself is installed (but with errors in language packs).
And obviously the problem is on the server side.
This code generates an error (I suspect that something is wrong with byte-by-byte reading)
// ----- Read byte per byte in order to find the signature
      $v_pos = ftell($this->zip_fd);
      $v_bytes = 0x00000000;
      while ($v_pos < $v_size)
      {
        // ----- Read a byte
        $v_byte = @fread($this->zip_fd, 1);

        // -----  Add the byte
        //$v_bytes = ($v_bytes << 8) | Ord($v_byte);
        // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
        // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
        $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);

        // ----- Compare the bytes
        if ($v_bytes == 0x504b0506)
        {
          $v_pos++;
          break;
        }

        $v_pos++;
      }

      // ----- Look if not found end of central dir
      if ($v_pos == $v_size)
      {

        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature");

        // ----- Return
        return PclZip::errorCode();
      }
    }

    // ----- Read the first 18 bytes of the header
    $v_binary_data = fread($this->zip_fd, 18);

    // ----- Look for invalid block size
    if (strlen($v_binary_data) != 18)
    {

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));

      // ----- Return
      return PclZip::errorCode();
    }

I didn't find any solution on the internet

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ramil, 2014-10-18
@Assada

As far as I understand, now many people have an unknown problem with "Akismet"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question