Recently, I ran into a peculiar problem while trying to update manually a WordPress theme file for a site I manage. Usually, I’ll just upload the theme file in a ZIP package then extract it using cPanel File manager without any issues with the file permissions.
On this occasion, however, the file permissions were for some reason unknown to me coming out incorrect — instead of permissions 0755 and 0644 for folders and files respectively, both were getting 0666 — the permission of the beast which implied this particular theme package was likely demon possessed!
Since I had no SSH access to the server, my only solution was to manually change the permissions using the cPanel File Manager context menu option. This however proved to be too time-consuming as it’s not possible to recursively set the permissions as is the case on SSH using the
In an attempt to salvage the situation, I did some searches online and quickly learnt that the issue was likely being caused by the ZIP file and not the server as I was suspecting (the server’s cPanel had recently been updated to the new Jupiter theme, hence my misplaced suspicions).
Armed with this information, I decided to put the ZIP file through a brief exorcism: this involved extracting the original ZIP file, then compressing it anew using 7-zip (though you can use other archivers such as the feature-packed WinZip). I then re-uploaded the born-again ZIP file back onto the server and extracted it once more.
Surprisingly, the permissions turned out correct this time! It would seem that my commandless commands drove out the demons just fine.