“Failed to decode zlib stream windows” – Composer Error ?

If you have landed on this page by searching this error in the Google, then I’m considering that you have tried everything you could to install composer on your pc but that’s not working, right?
You might be facing this error “Failed to decode zlib stream”. 

This happens because of the following reasons.

  • There might be some internet connection problem.
  • Maybe PHP Directory is not configured correctly in ‘Environment Variables’.
  • Maybe you’re not running the latest version of the PHP.

Coming to the Solution!

Solution 1:

  1. Create a folder in any of the drives.
  2. Name it as “Composer” or anything you like.
  3. Now, In that folder
    1. Go-to address bar, type “Notepad” & hit enter!
    2. Write the below-given code in the file!
      @ECHO  OFF  
      Php  “%~dp0composer.phar” %*
    3. Save as composer.bat in this folder.
    4. Download latest snapshot from Composer site. “Composer.phar” file will be downloaded!
    5. Paste it in the same directory as the above-created composer.bat file.
    6. Again, go-to address bar, type “cmd” & hit enter.
    7. In command prompt (cmd), type “composer” & hit enter.
    8. If you see some text-animated “Composer” word in big font than my friend you’ve passed the exam. If this step doesn’t work, do share in the comments.
  4. Now, copy that “Composer” Named folder.
  5. Paste it in “C:\Users\Username\AppData\Roaming”. The username will be your PC’s Login name.
  6. Now, Again open cmd –> type “composer” –> hit enter. If you see Big font “Composer” as output than well done.
  7. You have successfully installed Composer Globally!
  8. If the 6th step does not work, then follow the below steps!
    1. Press Windows+E –> Right-click –> Properties.
    2. Click on Advanced System Settings –> Environment Variables under Advanced tab  –> Edit “PATH” –> Add “C:\Users\Username\AppData\Roaming\Composer”.
    3. Click on okay & okay & okay until you get to the desktop!
  9. Now, repeat Step 6. If you fail, mention the error in the comment section.

I hope this works! If you’ve seen this error on your friend’s PC or somewhere else maybe, share this post and he might give you some present for the error’s solution!



Be the First to comment.

Leave a Comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: