Amazon EC2 - PHP GD image library

cqde picture cqde · May 25, 2011 · Viewed 19.8k times · Source

I've got a brand new install of WordPress setup and activated a custom-built theme along with a good amount of plugins. In the posts, I have built it so the user can create a post, upload an image as a thumbnail and it will automatically resize the image to a custom size set in my functions.php file.

All this has been working on my local end (MAMP) correctly but when I tried making everything work on our Amazon EC2 server, the images do not resize to the size set. They resize by actual code but do not resize the actual image and save it in the new size.

Apologies if the question/subject is completely non-sense but I have little to no experience with Amazon EC2 servers and I have been placed into a situation where the person in charge of all the work within EC2 had to leave the project.

I'm assuming that this has to do with the GD library not being installed.. I created a test page with phpinfo() and didn't see a GD area on the results page.

How would I go about installing the library on my Amazon EC2 server? I just learned how to connect to the server via Terminal and that's all I've got for now.. so you get an idea of how much I know about the subject.

Answer

Till picture Till · May 25, 2011

I'm guessing you have some type of Linux installed, probably Ubuntu or CentOS.

Ubuntu: sudo apt-get install php5-gd CentOS: sudo yum install php-gd

You probably have to restart Apache afterwards: service httpd restart or service apache2 restart -- the names differ from distribution to distribution.

Let me know if this works!