I just installed fivestar for drupal version 6.4 but I am getting some warning messages.
Messages like this:
# warning: imagecreatefrompng(modules/fivestar/widgets/oxygen/star-template.png?o=1219158819560) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /home/smith/web/home/sandbox/smithcms/gate/modules/fivestar/fivestar_color.inc on line 215.
# warning: imagealphablending(): supplied argument is not a valid Image resource in /home/smith/web/home/sandbox/smithcms/gate/modules/fivestar/fivestar_color.inc on line 216.
# warning: imagesx(): supplied argument is not a valid Image resource in /home/smith/web/home/sandbox/smithcms/gate/modules/fivestar/fivestar_color.inc on line 217.
# warning: imagesy(): supplied argument is not a valid Image resource in /home/smith/web/home/sandbox/smithcms/gate/modules/fivestar/fivestar_color.inc on line 218.

I tried changing the permissions to 777 as a test of the css, image, and widget directories but same errors.

Comments

ktleow’s picture

Me too, I have the exact same problem.

In fact the errors are almost 2 pages long.

EDIT: There are no errors with the default widget. (You have to clear your browser cache first).

quicksketch’s picture

The only thing that could be causing this is if the "modules/fivestar/widgets/oxygen/star-template.png" is not loaded on your system, or if the file is not readable by Fivestar. As a sidenote, you should install fivestar in "sites/all/modules/fivestar", not "modules/fivestar" (that directory is meant to be used only for core modules).

ktleow’s picture

I did install it in sites/all/modules. I suspect the problem is with widgets that has templates. Maybe the imagelibrary is causing the problem.

quicksketch’s picture

Sorry, that installation note was to jefbak2. The error message he posted indicated he had installed Fivestar in the root modules directory.

ktleow, could you confirm that the star-template.png files exist in your installation of Fivestar? It could also be caused by the GD library missing on your system. If you create an empty php file with nothing but this in it:

phpinfo();

Make sure that GD support is available and includes PNG support.

ktleow’s picture

Hmm now that error seems to be missing. But there's another problem. I've selected some custom color widgets, but unable to save the preferences properly.
Eg: I've set Color display to Default, but after that it changes back to Gradient display (previous setting).
I've even cleared my caches.

Anonymous’s picture

Version: 6.x-1.12 » 6.x-1.13

I'm having the same problem:

warning: imagepng() [function.imagepng]: Unable to open 'sites/default/files/fivestar/basic/star.png' for writing: Permission denied in /home/health/public_html/sites/all/modules/fivestar/fivestar_color.inc on line 184.
warning: imagepng() [function.imagepng]: Unable to open 'sites/default/files/fivestar/basic/cancel.png' for writing: Permission denied in /home/health/public_html/sites/all/modules/fivestar/fivestar_color.inc on line 185.
The selected file sites/all/modules/fivestar/widgets/basic/basic.css could not be uploaded, because the destination sites/default/files/fivestar/basic/basic.css is not properly configured.
The selected file sites/all/modules/fivestar/widgets/basic/basic-rtl.css could not be uploaded, because the destination sites/default/files/fivestar/basic/basic-rtl.css is not properly configured.

I'm made all file permissions writable, I've checked my GD/PNG support with phpinfo(), I don't know what else I can do? It just doesn't save custom color settings, it's stuck on the yellow/orange color gradient, even though I'm trying to save it as solid red.

When I first installed fivestar it didn't give me these errors, but I have since upgraded my server to php 5, and now it does. Could it be that?

Anonymous’s picture

Hello? Can anyone address this?

quicksketch’s picture

LiliVG, despite checking the permissions, this looks like a classic permissions problem. Check the permissions on your files directory (sites/default/files), then completely delete the fivestar file directory (sites/default/files/fivestar). Visit the Fivestar settings page and try to save the setting again, which will regenerate the files in that directory.

Anonymous’s picture

I have all my modules in sites/all/modules, does that make any difference? I did what you recommended, and there's no change, I still get all the same errors.

Anonymous’s picture

I just noticed, fivestar seems to have the "default" filename hardcoded, if you install this in sites/all/modules, it thinks files are missing because it's not under "sites/default/modules

quicksketch’s picture

No, no that's not correct at all. Fivestar saves files in "sites/default/files/fivestar", because that's the default file location (as configured at admin/settings/file-system). Fivestar the module is usually installed in "sites/all/modules/fivetar", but it can be installed in any valid module location.

What I recommended was deleting the files generated by Fivestar, not the module itself.

Anonymous’s picture

lol, I realized that after I posted. I've done that now, and I fixed the permissions in the sites/default/files directory. The permissions warnings are gone, but I still have 4 remaining warnings, and colors still won't save.

 - warning: imagepng() [function.imagepng]: Unable to open 'sites/default/files/fivestar/outline/star.png' for writing: No such file or directory in /home/health/public_html/sites/all/modules/fivestar/fivestar_color.inc on line 184.
 - warning: imagepng() [function.imagepng]: Unable to open 'sites/default/files/fivestar/outline/cancel.png' for writing: No such file or directory in /home/health/public_html/sites/all/modules/fivestar/fivestar_color.inc on line 185.
 - The selected file sites/all/modules/fivestar/widgets/outline/outline.css could not be uploaded, because the destination is not properly configured.
 - The selected file sites/all/modules/fivestar/widgets/outline/outline-rtl.css could not be uploaded, because the destination is not properly configured.
quicksketch’s picture

Well I'm still at a loss here. Try replacing Fivestar with a fresh copy, or even better, make a completely fresh Drupal installation and see if Fivestar works there. If it doesn't, then it has to be some kind of server configuration that is preventing it from working properly (the most likely situation).

Anonymous’s picture

Ok, I found the problem. Your module creates files to "nobody" on the server, so then my server doesn't have permission to modify the files under sites/default/files/fivestar because the server thinks it doesn't belong to me at all. I called my webhost and they changed the ownership of the directory and files to my username, and now I get no warnings, and everything is working perfectly.

quicksketch’s picture

Your module creates files to "nobody" on the server

It's not Fivestar that's doing this, it's the configuration of your server. Apache is setup to run as the user "nobody", so any files created by PHP (and therefor Apache) are always owned by the Apache runtime user. So any files you upload, any css files aggregated, and any Fivestar files created will all be owned by nobody. You can avoid the permissions problem by setting permissions on your files directories to 777.

Anonymous’s picture

So this should never be a problem again since my files directory is now 777? Even with other modules? That's good to know if it's true :)

quicksketch’s picture

Status: Active » Fixed

Yes that should be true, assuming you haven't placed other directories inside of your files directory that are NOT 777. In which case when Drupal tries to write to them, it'll have the same problem all over again.

I'm marking this as fixed. Anyone having trouble, try using your FTP client to set the file permissions (most FTP clients allow this) and set to 777. This is the equivelant of making it so that the "owner", "group", and "everyone" have "read", "write", and "execute" permissions. Or search drupal.org for the many other issues that have reported the same problem.

Anonymous’s picture

A note: if the file has been created to the user "nobody" on your server, you won't be able to change permissions on it, you'll have to call your webhost first have have them change the owner of the files and directories from "nobody" to your username. Then you'll be able to set everything to 777, and it'll be fine.

quicksketch’s picture

Thanks LiliVG for this extra tip, a good call.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.