“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!
- Create a folder in any of the drives.
- Name it as “Composer” or anything you like.
- Now, In that folder
- Go-to address bar, type “Notepad” & hit enter!
- Write the below-given code in the file!
Php “%~dp0composer.phar” %*
- Save as composer.bat in this folder.
- Download latest snapshot from Composer site. “Composer.phar” file will be downloaded!
- Paste it in the same directory as the above-created composer.bat file.
- Again, go-to address bar, type “cmd” & hit enter.
- In command prompt (cmd), type “composer” & hit enter.
- 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.
- Now, copy that “Composer” Named folder.
- Paste it in “C:\Users\Username\AppData\Roaming”. The username will be your PC’s Login name.
- Now, Again open cmd –> type “composer” –> hit enter. If you see Big font “Composer” as output than well done.
- You have successfully installed Composer Globally!
- If the 6th step does not work, then follow the below steps!
- Press Windows+E –> Right-click –> Properties.
- Click on Advanced System Settings –> Environment Variables under Advanced tab –> Edit “PATH” –> Add “C:\Users\Username\AppData\Roaming\Composer”.
- Click on okay & okay & okay until you get to the desktop!
- 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.