![]()
In the present day I bumped into an issue once I was attempting to setup a brand new WordPress based mostly web site hosted on a clear LEMP server utilizing Ubuntu. The factor I seen was that thumbnails and featured pictures the place not correctly resized, effectively they weren’t resized in any respect. Appropriate CSS kinds have been utilized however picture dimension remained uncropped. I did some analysis on WordPress.org and different WordPress associated help boards however might discover the reply.
Truly the very first thing that got here in my thoughts was that I made some errors in my theme pre as this was my very own customized theme. I pink each matter about
add_image_size
and
the_post_thumbnail
and couldn’t discover a single mistake in my pre. And turned out that I didn’t suck at PHP and WordPress performance but it surely turned out to be an even bigger downside and it has one thing to do with my server configuration (Ubuntu in my case). As soon as I noticed that it took a second to understand what's lacking – GD module for PHP5.
GD module for php5 is used to dealing with graphics immediately from PHP scripts. It helps the PNG, JPEG, XPM codecs in addition to Freetype/ttf fonts. If you happen to don’t have this PHP module put in it implies that a number of WordPress options gained’t work, reminiscent of picture resizer, picture cropping, thumbnail and featured picture generator and even oEmbed for Twitter, SoundCloud and different content material gained’t work. I realized this a tough means.
In case you are dealing with the identical points along with your WordPress set up you might be in the appropriate place as a result of I'll present you need to repair this. This can work solely in case you are operating your personal VPS/Devoted server operating Ubuntu and gained’t assist in case you are on shared internet hosting account. Nonetheless, you'll be able to ask them to put in GD PHP5 module for you however most shared host already has it put in. In case you are on shared website hosting it's extremely doubtless that featured pictures and thumbnails should not generated due to another purpose.
Answer for Ubuntu and Debian:
To put in GD PHP5 module on Ubuntu (any model after 12.04) and different Debian based mostly methods it is best to run the next instructions:
sudo apt-get set up php5-gd sudo service nginx restart
In case you might be on Apache (LAMP) server then you'll be able to restart it like this
sudo service apache2 restart
Answer for CentOS
sudo yum set up php-gd sudo service httpd restart
These easy instructions will set up GD PHP5 module on your Ubuntu/Debian or CentOS which can allow WordPress functionalities reminiscent of thumbnail generator, featured picture generator, picture editor, oEmbed and possibly some extra that I didn’t discover.
Let me know if this isn't the case in your state of affairs and I'll attempt to assist.