Today, a quite strange joomla problem crossed my way: I had developped a template and when I finally had zipped it, I couldn't install it:
Warning: file_put_contents() failed to open stream: permission denied in /xxxxxx/htdocs/libraries/joomla/utilities/compat/php50x.php on line 66
Well, I checked the templateDetails.xml file but everything seemed ok. Perhaps I had a problem with my local development server? So I took another joomla 1.5 template which I had already installed successfully on a client's server for testing purposes. As supposed there was no problem installing that template on my "joomla optimized" dev server.
I gave google the next chance to find a solution but I didn't find anything useful about my joomla-template-upload-problem. It seemed that the bug was neither in the template nor in the server configuration.
I didn't really believe that error could be in the way of zipping the template package but I gave my idea a try: I unzipped the template that I had uploaded successfully, then I deleted the zip-package and zipped back the template-files I had unpacked a minute ago with my IZarc zip software. The goal was to create the zip package by my own. When I tried to upload the template the second time I got the acknowledgement: The template-package didn't work and I got the same error like before with my fresh developped template.
Then I switched to my dev server's shell (it's a debian) and zipped the files via linux zip. Again, I tried to upload the package and - surprise, suprise - it worked!
I can't figure out why the first zip (windows based IZarc) was rejected and the second one (linux based zip) not, but if you came here because you were looking for a solution for your joomla throwing similar errors when you try to install a package, my advice is to zip the package again with another software (preferably linux based).