I installed ImageMagick (http://www.imagemagick.org) first, since the image module's install file said that it had to be installed for image to work correctly. I am using SuSE 9.0 and choose to use the rpm package to install ImageMagick. Then I started the installation of the image module.
In Following the install instructions the first problem was that my copy and paste of the mysql update command didn't work because the Install file gave wrong extension in the command. They used ".sql" instead of ".mysql" which is what the actual file used. Minor but confusing for a newbie.
After you finish the install, the first thing you MUST do is go to Home >> administer >> Images and check to see if there are any errors. It will save you a whole lot of time…. ;-)
When I checked for errors, the first error was: At the location, Home >> administer >> configuration >> modules >> Image -- 'convert.exe' was automatically put in the "Imagemagick Convert path:" box instead of 'convert' which was the files actual name.
The second error was: At the location, Home >> administer >> configuration >> modules >> Image -- it did not like any path that had a leading "/" but it insisted the path have a trailing "/"
The third error was: At the location, Home >> administer >> configuration >> modules >> Image -- it didn't like me creating the default and temporary paths as directories off of the root instead of relative to the Drupal installation directory -- You MUST create them relative to your Drupal installation directory -- i.e. in or in a directory attached to it. (The instructions explicitly told me where they had to be created. Duh…. Sometimes you have to wonder about yourself.)
On the Administer >> images page, the fourth and final error was:
Default image path -- NOT WRITABLE - change permissions on server
Default thumb path -- NOT WRITABLE - change permissions on server
Temporary image path -- NOT WRITABLE - change permissions on server
Ooops.... Not having a clue, I decided to pull out the good old knowledge extender "google" and search the Drupal forums while I was at it. After a lot of research I realized that I needed to run chmod the directories in some manner where, both I (as root) and the server, could access them.
The most common cure recommended was: "just set it to 777". A Linux guru friend recommended against this and said: "What I would recommend is to change the group of the directory to the group that the webserver is using and then change directory permissions to 775, or maybe 2775. That way, you (the owner of the files) and the web server have permission to read and write to them." (You know, it would have helped -- if it the error had said, "Change directory permissions so that the server can read and write the directories", instead of telling me to look on the server for some way to change permissions). Newbies can screw up anything... ;-)
This meant I needed to know the user/group that the webserver was using. The only way I could find, that you could find this was to write and run the following PHP program (you could use phpMyAdmin instead, if you have it installed on your machine):
phpinfo();
( This is what I got for user.group after running the above code on my machine: User/Group = wwwrun(30)/8 )
After looking at the incredible amount of information phpinfo() supplied, I decided to see if the php documentation said anything about this kind of problem. I came up with these two bits of information from the php FAQ sheet (which I have edited heavily for readability by newbies not familiar with setting file and directory permissions in Linux -- If I got anything wrong please correct me, I am certainly not an expert. ). While these two FAQs don't apply directly to installing the image module they do give you an overview of what changing permissions is like and should be really interesting to any paranoid type who is being hosted on a remote server.... ;-)
------------------------------
[FAQ # 1.8] I cannot insert a text file in a table, and I get an error about safe mode being in effect.
Answer: Your uploaded file is saved by PHP in the "upload dir", as defined in php.ini by the variable upload_tmp_dir (usually the system default is /tmp).
We recommend the following setup for Apache servers running in safe mode, to enable uploads of files while being reasonably secure:
* create a separate directory for uploads: mkdir /tmp/php
* give ownership to the Apache server's user.group by running this command while logged in as root:
chown apache.apache /tmp/php
(Where the first apache in apache.apache is the user that the apache server is using and the second apache is the group it is using.)
* give proper permissionby running this command while logged in as root:
chmod 600 /tmp/php
* set upload_tmp_dir = /tmp/php in php.ini
* restart Apache (They really mean this, nothing happens until you do. My machine restarts really fast so I just restart the entire machine. I know -- it's not a Windoze machine but I am lazy.)
------------------------------
[FAQ# 4.2] What's the preferred way of making phpMyAdmin secure against evil access.
Answer: This depends on your system. If you're running a server which cannot be accessed by other people, it's sufficient to use the directory protection bundled with your webserver (with Apache you can use .htaccess files, for example). If other people have telnet access to your server, you should use phpMyAdmin's HTTP authentication feature.
Suggestions:
*Permissions on your config.inc.php file should be changed to 666 using the command while logged in as root:
chmod 660 config.inc.php.
* All your phpMyAdmin files should have ownership set by running the command below on the individual files while logged in as root:
chown phpmy.apache (the phpMyAdmin file's names)
where phpmy is a user whose password is only known to you, and apache is the group under which Apache runs.
* You should use PHP safe mode, to protect from other users that try to include your config.inc.php in their scripts.
-------------------------------
So given all this information I decided to run the commands below against the three directories I created -- which MUST be relative to your Drupal installation directory -- i.e. either in or attached to it. In my case I used the directories below. It will be different for your setup.
chown wwwrun.8 /srv/www/htdocs/drupal/images
chown wwwrun.8 /srv/www/htdocs/drupal/images/thumbs
chown wwwrun.8 /srv/www/htdocs/drupal/images/tmp
and then:
chmod 775 /srv/www/htdocs/drupal/images
chmod 775 /srv/www/htdocs/drupal/images/thumbs
chmod 775 /srv/www/htdocs/drupal/images/tmp
Then I restarted Apache.
Be sure and go to "Home >> administer >> accounts >> Permissions" and set all image permissions or Durpal won't let you see the images.
Wow, the image module worked perfectly. Next step is figuring out how to use it...
Keith Daniels