Whilst trying to create my photo galleries, I was running into problem after problem – WordPress wasn’t automatically generating the thumbnails (so the images on the gallery page was 5000px long!)
After searching around, and reading some ridiculous things (such as having to make sure the functions.php had no blank lines) I found I needed GD Library installed for WordPress to be able to manipulate images. Luckily I wasn’t going to have to navigate the endless maze of hosting company ‘technical support’ because I manage my own server, which runs CentOS 5.6 with WHM/cPanel.
GD Library is natively a C application however wrappers have been written for PHP, so you can dynamically create and edit images in a variety of formats. Most server OS’s have it pre-installed, and if its’s not you should easily be able to get it from a repository.
There are two install methods I found worked on my servers.
If you want to use the terminal, run this to check if GD Library is already installed:
you can then install GD Library using YUM by running:
yum install php-gd service httpd restart
Or, if you have WHM/cPanel and would like to use it’s interface, you can!
- Open WHM and go to Software > Easy Apache
- Carry on through and don’t change any of the settings until you get to “Exhaustive Options” (Step 5)
- You’ll find the option for GD Library under PHP. Check the box, and carry on to build.
- Go get a coffee – don’t interupt the process unless you want to risk messing your server up!
- Restart Apache (using ‘service https restart’)
Now when you go back to WordPress you should find thumbnails are automatically generated on upload and the image editor is available.