Skip to content

Magento – Fix patch running error “Hunk #* FAILED at * (different line endings).”

If you’ve downloaded a copy of Magento or migrated a copy of Magento from a Windows environment to a Linux environment, you may run into this problem when applying SUPEE security patches.

It’s possible that all the PHP files have dos line-endings. Converting them to unix line endings solves this.

Go to Magento directory, wherever it might be. Eg..

cd /var/www/magento

This will recursively look for files from the current directory and invoke dos2unix command on them

find . -type f -exec dos2unix {} \;

With thanks to http://stackoverflow.com/questions/11929461/how-can-i-run-dos2unix-on-an-entire-directory/11929475#11929475

About 

10 years + experience in web development working with lots of different technology.

Published inLinuxMagentoPHP

Be First to Comment

Leave a Reply

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