Posts Tagged ‘tech’

Wordpress thumbnail generation disabled

Tuesday, June 23rd, 2009

No thumbnails in your wordpress? Read on…

I noticed last night that my wordpress is not generating thumbnails from uploaded images like it’s suppose to. You’ll noticed that the size options (thumbnail, medium, large) are all disabled except for the full size.

wordpress-size-options

After doing a lot of searching, I finally found out that in order for wordpress to generate thumbnails “by default”, you need to have GD library support for your php. It would have been nice if wordpress had documented that better.

The only reference I found was this:

http://wordpress.org/support/topic/235625

To be clear, wordpress does not generate thumbnails by default unless your php instance has GD support.

Install php gd library

For me, installing GD library was easy:

# yum install php-gd

Check for gd

To check if you have GD loaded in php:

# php -m
[PHP Modules]
bz2
calendar
ctype
curl
date
dbase
exif
ftp
gd
gettext
gmp
hash
iconv

this version of PCRE is not compiled with PCRE_UTF8 support

Monday, June 22nd, 2009

After installing wordpress, I got a lot of these errors in my apache wordpress error log.

PHP Warning:  preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]:
Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in ...

I am running apache 2.2.8 and it uses the built-in version 5 of pcre.

http://httpd.apache.org/docs/2.2/new_features_2_2.html

The problem is that version 5 of pcre does not contain UTF-8 support.  So I had to recompile apache with a newer version of pcre. Luckily I have pcre 6.6 already installed on my linux box.

>> rpm -qa |grep -i pcre
pcre-devel-6.6-2.el5_0.1
pcre-6.6-2.el5_0.1
pcre-6.6-2.el5_0.1

So all I had to do is re-compile apache with the “–with-pcre” flag.

./configure --with-pcre

If you don’t know what version of pcre your php is using, create a phpinfo script and hit it with your broswer.  You should see…

pcre version

Happy compiling…

Moving to wordpress 2.8

Monday, June 22nd, 2009

I’ve finally moved chiaocheng.com to wordpress.  I have been looking for ways to add content more easily than writing up html pages.  To achieve that, I focused on two types of software, blogs and wiki’s.  Initially, I had hoped to keep my site on java for integration purposes.  My photo album is running off tomcat and so keeping things in java would have allowed me to include my photo album without redirecting to a new site.  I looked at several java solutions such as jspwiki and jamwiki but unfortunately, I didn’t find anything suitable.  I finally decided to ditch the java requirement.  After that, the choice got a lot easier since wordpress is very popular, thus having a lot of community built support around it.

Another important factor for me was the ability to customize the software.  Not only the legal ability but also the ease to understand and change the underlying software.  Not being a php guy, I’ve been pleasantly surprised how easy and straight forward to understand and modify the code base.  The bad part is that it looks very much like procedural spagehiti code resembling much of what you would see if a java web app was written completely in jsp.

Just a few weeks ago, wordpress 2.8 came out.  So I installed the new version and it seems like a lot of the buggy admin functions are now fixed.  Using wordpress 2.7, I felt a lot of the backend pages had bugs.  Luckily for me, 2.8 came out at the perfect time.

You can find my old website here: old.chiaocheng.com. It going to take me some time to move everything over.

And guess what, you just read my first ever blog post!

Happy blogging.